⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qsnet-rhel4-2.6.patch

📁 lustre 1.6.5 source code
💻 PATCH
📖 第 1 页 / 共 4 页
字号:
+#include <linux/ptrack.h>  #define INIT_FILES \ { 							\@@ -112,6 +113,7 @@ extern struct group_info init_groups; 	.proc_lock	= SPIN_LOCK_UNLOCKED,				\ 	.switch_lock	= SPIN_LOCK_UNLOCKED,				\ 	.journal_info	= NULL,						\+	INIT_TASK_PTRACK(tsk)						\ }  Index: linux-269-5502/include/linux/ioproc.h===================================================================--- /dev/null+++ linux-269-5502/include/linux/ioproc.h@@ -0,0 +1,270 @@+/*+ *    Copyright (C) 2006 Quadrics Ltd+ *+ *    This program is free software; you can redistribute it and/or modify+ *    it under the terms of the GNU General Public License as published by+ *    the Free Software Foundation; either version 2 of the License, or+ *    (at your option) any later version.+ *+ *    This program is distributed in the hope that it will be useful,+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+ *    GNU General Public License for more details.+ *+ *    You should have received a copy of the GNU General Public License+ *    along with this program; if not, write to the Free Software+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+ */++/*+ * Callbacks for IO processor page table updates.+ */++#ifndef __LINUX_IOPROC_H__+#define __LINUX_IOPROC_H__++#include <linux/sched.h>+#include <linux/mm.h>++typedef struct ioproc_ops {+	struct ioproc_ops *next;+	void *arg;++	void (*release) (void *arg, struct mm_struct * mm);+	void (*sync_range) (void *arg, struct vm_area_struct * vma,+			    unsigned long start, unsigned long end);+	void (*invalidate_range) (void *arg, struct vm_area_struct * vma,+				  unsigned long start, unsigned long end);+	void (*update_range) (void *arg, struct vm_area_struct * vma,+			      unsigned long start, unsigned long end);++	void (*change_protection) (void *arg, struct vm_area_struct * vma,+				   unsigned long start, unsigned long end,+				   pgprot_t newprot);++	void (*sync_page) (void *arg, struct vm_area_struct * vma,+			   unsigned long address);+	void (*invalidate_page) (void *arg, struct vm_area_struct * vma,+				 unsigned long address);+	void (*update_page) (void *arg, struct vm_area_struct * vma,+			     unsigned long address);++} ioproc_ops_t;++/* IOPROC Registration+ * + * Called by the IOPROC device driver to register its interest in page table+ * changes for the process associated with the supplied mm_struct+ *+ * The caller should first allocate and fill out an ioproc_ops structure with + * the function pointers initialised to the device driver specific code for+ * each callback. If the device driver doesn't have code for a particular + * callback then it should set the function pointer to be NULL.+ * The ioproc_ops arg parameter will be passed unchanged as the first argument+ * to each callback function invocation.+ *+ * The ioproc registration is not inherited across fork() and should be called+ * once for each process that the IOPROC device driver is interested in.+ *+ * Must be called holding the mm->page_table_lock+ */+extern int ioproc_register_ops(struct mm_struct *mm, struct ioproc_ops *ip);++/* IOPROC De-registration+ * + * Called by the IOPROC device driver when it is no longer interested in page + * table changes for the process associated with the supplied mm_struct+ *+ * Normally this is not needed to be called as the ioproc_release() code will+ * automatically unlink the ioproc_ops struct from the mm_struct as the+ * process exits+ *+ * Must be called holding the mm->page_table_lock+ */+extern int ioproc_unregister_ops(struct mm_struct *mm, struct ioproc_ops *ip);++#ifdef CONFIG_IOPROC++/* IOPROC Release+ *+ * Called during exit_mmap() as all vmas are torn down and unmapped.+ *+ * Also unlinks the ioproc_ops structure from the mm list as it goes.+ *+ * No need for locks as the mm can no longer be accessed at this point+ *+ */+static inline void ioproc_release(struct mm_struct *mm)+{+	struct ioproc_ops *cp;++	while ((cp = mm->ioproc_ops) != NULL) {+		mm->ioproc_ops = cp->next;++		if (cp->release)+			cp->release(cp->arg, mm);+	}+}++/* IOPROC SYNC RANGE+ *+ * Called when a memory map is synchronised with its disk image i.e. when the + * msync() syscall is invoked. Any future read or write to the associated + * pages by the IOPROC should cause the page to be marked as referenced or + * modified.+ *+ * Called holding the mm->page_table_lock+ */+static inline void+ioproc_sync_range(struct vm_area_struct *vma, unsigned long start,+		  unsigned long end)+{+	struct ioproc_ops *cp;++	for (cp = vma->vm_mm->ioproc_ops; cp; cp = cp->next)+		if (cp->sync_range)+			cp->sync_range(cp->arg, vma, start, end);+}++/* IOPROC INVALIDATE RANGE+ *+ * Called whenever a valid PTE is unloaded e.g. when a page is unmapped by the+ * user or paged out by the kernel. + *+ * After this call the IOPROC must not access the physical memory again unless+ * a new translation is loaded.+ *+ * Called holding the mm->page_table_lock+ */+static inline void+ioproc_invalidate_range(struct vm_area_struct *vma, unsigned long start,+			unsigned long end)+{+	struct ioproc_ops *cp;++	for (cp = vma->vm_mm->ioproc_ops; cp; cp = cp->next)+		if (cp->invalidate_range)+			cp->invalidate_range(cp->arg, vma, start, end);+}++/* IOPROC UPDATE RANGE+ *+ * Called whenever a valid PTE is loaded e.g. mmaping memory, moving the brk + * up, when breaking COW or faulting in an anonymous page of memory.+ *+ * These give the IOPROC device driver the opportunity to load translations + * speculatively, which can improve performance by avoiding device translation+ * faults.+ *+ * Called holding the mm->page_table_lock+ */+static inline void+ioproc_update_range(struct vm_area_struct *vma, unsigned long start,+		    unsigned long end)+{+	struct ioproc_ops *cp;++	for (cp = vma->vm_mm->ioproc_ops; cp; cp = cp->next)+		if (cp->update_range)+			cp->update_range(cp->arg, vma, start, end);+}++/* IOPROC CHANGE PROTECTION+ *+ * Called when the protection on a region of memory is changed i.e. when the + * mprotect() syscall is invoked.+ *+ * The IOPROC must not be able to write to a read-only page, so if the + * permissions are downgraded then it must honour them. If they are upgraded + * it can treat this in the same way as the ioproc_update_[range|sync]() calls+ *+ * Called holding the mm->page_table_lock+ */+static inline void+ioproc_change_protection(struct vm_area_struct *vma, unsigned long start,+			 unsigned long end, pgprot_t newprot)+{+	struct ioproc_ops *cp;++	for (cp = vma->vm_mm->ioproc_ops; cp; cp = cp->next)+		if (cp->change_protection)+			cp->change_protection(cp->arg, vma, start, end,+					      newprot);+}++/* IOPROC SYNC PAGE+ *+ * Called when a memory map is synchronised with its disk image i.e. when the + * msync() syscall is invoked. Any future read or write to the associated page+ * by the IOPROC should cause the page to be marked as referenced or modified.+ *+ * Not currently called as msync() calls ioproc_sync_range() instead+ *+ * Called holding the mm->page_table_lock+ */+static inline void+ioproc_sync_page(struct vm_area_struct *vma, unsigned long addr)+{+	struct ioproc_ops *cp;++	for (cp = vma->vm_mm->ioproc_ops; cp; cp = cp->next)+		if (cp->sync_page)+			cp->sync_page(cp->arg, vma, addr);+}++/* IOPROC INVALIDATE PAGE+ *+ * Called whenever a valid PTE is unloaded e.g. when a page is unmapped by the+ * user or paged out by the kernel. + *+ * After this call the IOPROC must not access the physical memory again unless+ * a new translation is loaded.+ *+ * Called holding the mm->page_table_lock+ */+static inline void+ioproc_invalidate_page(struct vm_area_struct *vma, unsigned long addr)+{+	struct ioproc_ops *cp;++	for (cp = vma->vm_mm->ioproc_ops; cp; cp = cp->next)+		if (cp->invalidate_page)+			cp->invalidate_page(cp->arg, vma, addr);+}++/* IOPROC UPDATE PAGE+ *+ * Called whenever a valid PTE is loaded e.g. mmaping memory, moving the brk + * up, when breaking COW or faulting in an anoymous page of memory.+ *+ * These give the IOPROC device the opportunity to load translations + * speculatively, which can improve performance by avoiding device translation+ * faults.+ *+ * Called holding the mm->page_table_lock+ */+static inline void+ioproc_update_page(struct vm_area_struct *vma, unsigned long addr)+{+	struct ioproc_ops *cp;++	for (cp = vma->vm_mm->ioproc_ops; cp; cp = cp->next)+		if (cp->update_page)+			cp->update_page(cp->arg, vma, addr);+}++#else++/* ! CONFIG_IOPROC so make all hooks empty */++#define ioproc_release(mm)				do { } while (0)+#define ioproc_sync_range(vma, start, end)		do { } while (0)+#define ioproc_invalidate_range(vma, start, end)	do { } while (0)+#define ioproc_update_range(vma, start, end)		do { } while (0)+#define ioproc_change_protection(vma, start, end, prot)	do { } while (0)+#define ioproc_sync_page(vma, addr)			do { } while (0)+#define ioproc_invalidate_page(vma, addr)		do { } while (0)+#define ioproc_update_page(vma, addr)			do { } while (0)++#endif				/* CONFIG_IOPROC */+#endif				/* __LINUX_IOPROC_H__ */Index: linux-269-5502/include/linux/sched.h===================================================================--- linux-269-5502.orig/include/linux/sched.h+++ linux-269-5502/include/linux/sched.h@@ -185,6 +185,9 @@ extern signed long schedule_timeout_unin asmlinkage void schedule(void);  struct namespace;+#ifdef CONFIG_IOPROC+struct ioproc_ops;+#endif  /* Maximum number of active map areas.. This is a random (large) number */ #define DEFAULT_MAX_MAP_COUNT	65536@@ -260,6 +263,11 @@ struct mm_struct { 	struct kioctx		*ioctx_list;  	struct kioctx		default_kioctx;+ +#ifdef CONFIG_IOPROC+ 	/* hooks for io devices with advanced RDMA capabilities */+	struct ioproc_ops       *ioproc_ops;+#endif };  extern int mmlist_nr;@@ -635,6 +643,10 @@ struct task_struct {   	struct mempolicy *mempolicy;   	short il_next;		/* could be shared with used_math */ #endif+#ifdef CONFIG_PTRACK+/* process tracking callback */+	struct list_head ptrack_list;+#endif };  static inline pid_t process_group(struct task_struct *tsk)Index: linux-269-5502/include/linux/ptrack.h===================================================================--- /dev/null+++ linux-269-5502/include/linux/ptrack.h@@ -0,0 +1,65 @@+/*+ *    Copyright (C) 2000  Regents of the University of California+ *+ *    This program is free software; you can redistribute it and/or modify+ *    it under the terms of the GNU General Public License as published by+ *    the Free Software Foundation; either version 2 of the License, or+ *    (at your option) any later version.+ *+ *    This program is distributed in the hope that it will be useful,+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+ *    GNU General Public License for more details.+ *+ *    You should have received a copy of the GNU General Public License+ *    along with this program; if not, write to the Free Software+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+ *+ * Derived from exit_actn.c by+ *    Copyright (C) 2003 Quadrics Ltd.+ *+ */+#ifndef __LINUX_PTRACK_H+#define __LINUX_PTRACK_H++/* + * Process tracking - this allows a module to keep track of processes+ * in order that it can manage all tasks derived from a single process.+ */++#define PTRACK_PHASE_CLONE	1+#define PTRACK_PHASE_CLONE_FAIL	2+#define PTRACK_PHASE_EXEC	3+#define PTRACK_PHASE_EXIT      	4++#define PTRACK_FINISHED		0+#define PTRACK_INNHERIT		1+#define PTRACK_DENIED		2++#ifdef CONFIG_PTRACK++typedef int (*ptrack_callback_t)(void *arg, int phase, struct task_struct *child);++struct ptrack_desc {+       struct list_head        link;+       ptrack_callback_t       callback;+       void                   *arg;+};++extern int     ptrack_register (ptrack_callback_t callback, void *arg);+extern void    ptrack_deregister (ptrack_callback_t callback, void *arg);+extern int     ptrack_registered (ptrack_callback_t callback, void *arg);++extern int     ptrack_call_callbacks (int phase, struct task_struct *child);++#define INIT_TASK_PTRACK(tsk) \+	.ptrack_list = LIST_HEAD_INIT(tsk.ptrack_list)++#else+#define ptrack_call_callbacks (phase, child) (0)++#define INIT_TASK_PTRACK(tsk)++#endif++#endif /* __LINUX_PTRACK_H */Index: linux-269-5502/include/asm-ia64/param.h===================================================================--- linux-269-5502.orig/include/asm-ia64/param.h+++ linux-269-5502/include/asm-ia64/param.h@@ -27,7 +27,7 @@    */ #  define HZ	  32 # else-#  define HZ	1024+#  define HZ	100 # endif # define USER_HZ	HZ # define CLOCKS_PER_SEC	HZ	/* frequency at which times() counts */Index: linux-269-5502/include/asm-i386/param.h===================================================================--- linux-269-5502.orig/include/asm-i386/param.h+++ linux-269-5502/include/asm-i386/param.h@@ -2,7 +2,7 @@ #define _ASMi386_PARAM_H  #ifdef __KERNEL__-# define HZ		1000		/* Internal kernel timer frequency */+# define HZ		100		/* Internal kernel timer frequency */ # define USER_HZ	100		/* .. some user interfaces are in "ticks" */ # define CLOCKS_PER_SEC		(USER_HZ)	/* like times() */ #endifIndex: linux-269-5502/include/asm-x86_64/param.h===================================================================--- linux-269-5502.orig/include/asm-x86_64/param.h+++ linux-269-5502/include/asm-x86_64/param.h@@ -2,7 +2,7 @@ #define _ASMx86_64_PARAM_H  #ifdef __KERNEL__-# define HZ            1000            /* Internal kernel timer frequency */+# define HZ            100            /* Internal kernel timer frequency */ # define USER_HZ       100          /* .. some user interfaces are in "ticks */ #define CLOCKS_PER_SEC        (USER_HZ)       /* like times() */ #endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -