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

📄 qsnet-suse-2.6.patch

📁 非常经典的一个分布式系统
💻 PATCH
📖 第 1 页 / 共 4 页
字号:
+	ioproc_update_page+++==== FUNCTION+	do_swap_page++CALLED FROM+	handle_pte_fault++PTE MODIFICATION+	set_pte++ADDED HOOKS+	ioproc_update_page+++==== FUNCTION+	do_anonymous_page++CALLED FROM+	do_no_page++PTE MODIFICATION+	set_pte++ADDED HOOKS+	ioproc_update_page+++==== FUNCTION+	do_no_page++CALLED FROM+	do_file_page, handle_pte_fault++PTE MODIFICATION+	set_pte++ADDED HOOKS+	ioproc_update_page+++++++ FILE+	mm/mmap.c++==== FUNCTION+	unmap_region++CALLED FROM+	do_munmap++PTE MODIFICATION+	set_pte (unmap_vmas)++ADDED HOOKS+	ioproc_invalidate_range+++==== FUNCTION+	exit_mmap++CALLED FROM+	mmput++PTE MODIFICATION+	set_pte (unmap_vmas)++ADDED HOOKS+	ioproc_release+++++++ FILE+	mm/mprotect.c++==== FUNCTION+	change_protection++CALLED FROM+	mprotect_fixup++PTE MODIFICATION+	set_pte (change_pte_range)++ADDED HOOKS+	ioproc_change_protection+++++++ FILE+	mm/mremap.c++==== FUNCTION+	move_page_tables++CALLED FROM+	move_vma++PTE MODIFICATION+	ptep_clear_flush (move_one_page)++ADDED HOOKS+	ioproc_invalidate_range+	ioproc_invalidate_range+++++++ FILE+	mm/rmap.c++==== FUNCTION+	try_to_unmap_one++CALLED FROM+	try_to_unmap_anon, try_to_unmap_file++PTE MODIFICATION+	ptep_clear_flush++ADDED HOOKS+	ioproc_invalidate_page+++==== FUNCTION+	try_to_unmap_cluster++CALLED FROM+	try_to_unmap_file++PTE MODIFICATION+	ptep_clear_flush++ADDED HOOKS+	ioproc_invalidate_page++++++++ FILE +	mm/msync.c++==== FUNCTION+	filemap_sync++CALLED FROM+	msync_interval++PTE MODIFICATION+	ptep_clear_flush_dirty (filemap_sync_pte)++ADDED HOOKS+	ioproc_sync_range+++++++ FILE+	mm/hugetlb.c++==== FUNCTION+	zap_hugepage_range++CALLED FROM+	hugetlb_vmtruncate_list++PTE MODIFICATION+	ptep_get_and_clear (unmap_hugepage_range)++ADDED HOOK+	ioproc_invalidate_range+++-- Last update DavidAddison - 17 Aug 2004Index: LINUX-SRC-TREE/fs/exec.c===================================================================--- LINUX-SRC-TREE.orig/fs/exec.c+++ LINUX-SRC-TREE/fs/exec.c@@ -65,6 +65,8 @@ EXPORT_SYMBOL(coredump_notifier_list); #include <linux/kmod.h> #endif +#include <linux/ptrack.h>+ int core_uses_pid; char core_pattern[65] = "core"; int suid_dumpable = 0;@@ -1213,6 +1215,9 @@ int do_execve(char * filename, 	if (retval < 0) 		goto out; +	/* notify any ptrack callbacks of the process exec */+	ptrack_call_callbacks(PTRACK_PHASE_EXEC, NULL);+ 	retval = search_binary_handler(&bprm,regs); 	if (retval >= 0) { 		TRIG_EVENT(exec_hook, file->f_dentry->d_name.len,Index: LINUX-SRC-TREE/fs/read_write.c===================================================================--- LINUX-SRC-TREE.orig/fs/read_write.c+++ LINUX-SRC-TREE/fs/read_write.c@@ -339,6 +339,7 @@ asmlinkage ssize_t sys_write(unsigned in  	return ret; }+EXPORT_SYMBOL_GPL(sys_write);  asmlinkage ssize_t sys_pread64(unsigned int fd, char __user *buf, 			     size_t count, loff_t pos)Index: LINUX-SRC-TREE/fs/select.c===================================================================--- LINUX-SRC-TREE.orig/fs/select.c+++ LINUX-SRC-TREE/fs/select.c@@ -649,3 +649,4 @@ ssize_t generic_aio_poll(struct kiocb *i 	} 	return -EIOCBRETRY; }+EXPORT_SYMBOL_GPL(sys_poll);Index: LINUX-SRC-TREE/include/linux/init_task.h===================================================================--- LINUX-SRC-TREE.orig/include/linux/init_task.h+++ LINUX-SRC-TREE/include/linux/init_task.h@@ -3,6 +3,7 @@  #include <linux/file.h> #include <linux/pagg.h>+#include <linux/ptrack.h>  #define INIT_FILES \ { 							\@@ -116,6 +117,7 @@ extern struct group_info init_groups; 	.map_base	= __TASK_UNMAPPED_BASE,				\ 	.io_wait	= NULL,						\ 	INIT_TASK_PAGG(tsk)						\+	INIT_TASK_PTRACK(tsk)						\ }  Index: LINUX-SRC-TREE/include/linux/ioproc.h===================================================================--- /dev/null+++ LINUX-SRC-TREE/include/linux/ioproc.h@@ -0,0 +1,271 @@+/* -*- linux-c -*-+ *+ *    Copyright (C) 2002-2004 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);+}+

⌨️ 快捷键说明

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