📄 qsnet-suse-2.6.patch
字号:
+ if (phase == PTRACK_PHASE_CLONE)+ INIT_LIST_HEAD (&child->ptrack_list);++ list_for_each_safe (el, nel, ¤t->ptrack_list) {+ struct ptrack_desc *desc = list_entry (el, struct ptrack_desc, link);+ + res = desc->callback (desc->arg, phase, child);+ + switch (phase)+ {+ case PTRACK_PHASE_EXIT:+ list_del (&desc->link);+ kfree (desc);+ break;+ + case PTRACK_PHASE_CLONE:+ switch (res)+ {+ case PTRACK_FINISHED:+ break;++ case PTRACK_INNHERIT:+ if ((new = kmalloc (sizeof (struct ptrack_desc), GFP_ATOMIC)) == NULL)+ {+ /* allocation failed - notify that this process is not going+ * to be started by signalling clone failure.+ */+ desc->callback (desc->arg, PTRACK_PHASE_CLONE_FAIL, child);+ + goto failed;+ }++ new->callback = desc->callback;+ new->arg = desc->arg;+ + list_add_tail (&new->link, &child->ptrack_list);+ break;++ case PTRACK_DENIED:+ goto failed;+ }+ break;+ }+ }++ return 0;++ failed:+ while (! list_empty (&child->ptrack_list))+ {+ struct ptrack_desc *desc = list_entry (child->ptrack_list.next, struct ptrack_desc, link);+ + desc->callback (desc->arg, PTRACK_PHASE_CLONE_FAIL, child);++ list_del (&desc->link);+ kfree (desc);+ }+ return 1;+}+EXPORT_SYMBOL(ptrack_register);+EXPORT_SYMBOL(ptrack_deregister);+EXPORT_SYMBOL(ptrack_registered);Index: LINUX-SRC-TREE/kernel/signal.c===================================================================--- LINUX-SRC-TREE.orig/kernel/signal.c+++ LINUX-SRC-TREE/kernel/signal.c@@ -2315,6 +2315,7 @@ sys_tkill(int pid, int sig) read_unlock(&tasklist_lock); return audit_lresult(error); }+EXPORT_SYMBOL_GPL(sys_kill); asmlinkage long sys_rt_sigqueueinfo(int pid, int sig, siginfo_t __user *uinfo)Index: LINUX-SRC-TREE/mm/fremap.c===================================================================--- LINUX-SRC-TREE.orig/mm/fremap.c+++ LINUX-SRC-TREE/mm/fremap.c@@ -14,6 +14,7 @@ #include <linux/swapops.h> #include <linux/objrmap.h> #include <linux/module.h>+#include <linux/ioproc.h> #include <asm/mmu_context.h> #include <asm/cacheflush.h>@@ -29,6 +30,7 @@ static inline void zap_pte(struct mm_str if (pte_present(pte)) { unsigned long pfn = pte_pfn(pte); + ioproc_invalidate_page(vma, addr); flush_cache_page(vma, addr); pte = ptep_clear_flush(vma, addr, ptep); if (pfn_valid(pfn)) {@@ -80,6 +82,7 @@ int install_page(struct mm_struct *mm, s pte_val = *pte; pte_unmap(pte); update_mmu_cache(vma, addr, pte_val);+ ioproc_update_page(vma, addr); err = 0; err_unlock:@@ -118,6 +121,7 @@ int install_file_pte(struct mm_struct *m pte_val = *pte; pte_unmap(pte); update_mmu_cache(vma, addr, pte_val);+ ioproc_update_page(vma, addr); spin_unlock(&mm->page_table_lock); return 0; Index: LINUX-SRC-TREE/mm/ioproc.c===================================================================--- /dev/null+++ LINUX-SRC-TREE/mm/ioproc.c@@ -0,0 +1,58 @@+/* -*- 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+ *+ *+ */++/*+ * Registration for IO processor page table updates.+ */++#include <linux/kernel.h>+#include <linux/module.h>++#include <linux/mm.h>+#include <linux/ioproc.h>++int+ioproc_register_ops(struct mm_struct *mm, struct ioproc_ops *ip)+{+ ip->next = mm->ioproc_ops;+ mm->ioproc_ops = ip;++ return 0;+}++EXPORT_SYMBOL_GPL(ioproc_register_ops);++int+ioproc_unregister_ops(struct mm_struct *mm, struct ioproc_ops *ip)+{+ struct ioproc_ops **tmp;++ for (tmp = &mm->ioproc_ops; *tmp && *tmp != ip; tmp= &(*tmp)->next)+ ;+ if (*tmp) {+ *tmp = ip->next;+ return 0;+ }++ return -EINVAL;+}++EXPORT_SYMBOL_GPL(ioproc_unregister_ops);Index: LINUX-SRC-TREE/mm/Kconfig===================================================================--- /dev/null+++ LINUX-SRC-TREE/mm/Kconfig@@ -0,0 +1,15 @@+#+# VM subsystem specific config+# ++# Support for IO processors which have advanced RDMA capabilities+#+config IOPROC+ bool "Enable IOPROC VM hooks"+ depends on MMU+ default y+ help+ This option enables hooks in the VM subsystem so that IO devices which+ incorporate advanced RDMA capabilities can be kept in sync with CPU + page table changes.+ See Documentation/vm/ioproc.txt for more details.Index: LINUX-SRC-TREE/mm/Makefile===================================================================--- LINUX-SRC-TREE.orig/mm/Makefile+++ LINUX-SRC-TREE/mm/Makefile@@ -15,4 +15,5 @@ obj-y := bootmem.o filemap.o mempool.o obj-$(CONFIG_SWAP) += page_io.o swap_state.o swapfile.o obj-$(CONFIG_PROC_MM) += proc_mm.o obj-$(CONFIG_NUMA) += policy.o+obj-$(CONFIG_IOPROC) += ioproc.o Index: LINUX-SRC-TREE/mm/memory.c===================================================================--- LINUX-SRC-TREE.orig/mm/memory.c+++ LINUX-SRC-TREE/mm/memory.c@@ -43,6 +43,7 @@ #include <linux/swap.h> #include <linux/highmem.h> #include <linux/pagemap.h>+#include <linux/ioproc.h> #include <linux/objrmap.h> #include <linux/module.h> #include <linux/acct.h>@@ -627,6 +628,7 @@ void zap_page_range(struct vm_area_struc lru_add_drain(); spin_lock(&mm->page_table_lock);+ ioproc_invalidate_range(vma, address, end); tlb = tlb_gather_mmu(mm, 0); unmap_vmas(&tlb, mm, vma, address, end, &nr_accounted, details); tlb_finish_mmu(tlb, address, end);@@ -927,6 +929,7 @@ int zeromap_page_range(struct vm_area_st BUG(); spin_lock(&mm->page_table_lock);+ ioproc_invalidate_range(vma, beg, end); do { pmd_t *pmd = pmd_alloc(mm, dir, address); error = -ENOMEM;@@ -941,6 +944,7 @@ int zeromap_page_range(struct vm_area_st /* * Why flush? zeromap_pte_range has a BUG_ON for !pte_none() */+ ioproc_update_range(vma, beg, end); flush_tlb_range(vma, beg, end); spin_unlock(&mm->page_table_lock); return error;@@ -1011,6 +1015,7 @@ int remap_page_range(struct vm_area_stru BUG(); spin_lock(&mm->page_table_lock);+ ioproc_invalidate_range(vma, beg, end); do { pmd_t *pmd = pmd_alloc(mm, dir, from); error = -ENOMEM;@@ -1025,6 +1030,7 @@ int remap_page_range(struct vm_area_stru /* * Why flush? remap_pte_range has a BUG_ON for !pte_none() */+ ioproc_update_range(vma, beg, end); flush_tlb_range(vma, beg, end); spin_unlock(&mm->page_table_lock); return error;@@ -1098,6 +1104,7 @@ static int do_wp_page(struct mm_struct * update_mmu_cache(vma, address, entry); lazy_mmu_prot_update(entry); pte_unmap(page_table);+ ioproc_update_page(vma, address); spin_unlock(&mm->page_table_lock); return VM_FAULT_MINOR; }@@ -1133,6 +1140,7 @@ static int do_wp_page(struct mm_struct * } page_remove_rmap(old_page);+ ioproc_invalidate_page(vma, address); break_cow(vma, new_page, address, page_table); page_add_rmap(new_page, vma, address, 1); lru_cache_add_active(new_page);@@ -1141,6 +1149,7 @@ static int do_wp_page(struct mm_struct * new_page = old_page; } pte_unmap(page_table);+ ioproc_update_page(vma, address); page_cache_release(new_page); page_cache_release(old_page); spin_unlock(&mm->page_table_lock);@@ -1376,6 +1385,7 @@ static int do_swap_page(struct mm_struct int ret; pte_unmap(page_table);+ ioproc_update_page(vma, address); spin_unlock(&mm->page_table_lock); BUG_ON(!vma->anon_vma);@@ -1508,6 +1518,7 @@ do_anonymous_page(struct mm_struct *mm, /* No need to invalidate - it was non-present before */ update_mmu_cache(vma, addr, entry);+ ioproc_update_page(vma, addr); spin_unlock(&mm->page_table_lock); ret = VM_FAULT_MINOR; @@ -1658,6 +1669,7 @@ retry: /* no need to invalidate: a not-present page shouldn't be cached */ update_mmu_cache(vma, address, entry);+ ioproc_update_page(vma, address); spin_unlock(&mm->page_table_lock); out: return ret;@@ -1771,6 +1783,7 @@ static inline int handle_pte_fault(struc spin_unlock(&mm->page_table_lock); return VM_FAULT_MINOR; }+EXPORT_SYMBOL_GPL(make_pages_present); /* Can be overwritten by the architecture */Index: LINUX-SRC-TREE/mm/mmap.c===================================================================--- LINUX-SRC-TREE.orig/mm/mmap.c+++ LINUX-SRC-TREE/mm/mmap.c@@ -25,6 +25,7 @@ #include <linux/init.h> #include <linux/file.h> #include <linux/fs.h>+#include <linux/ioproc.h> #include <linux/personality.h> #include <linux/security.h> #include <linux/hugetlb.h>@@ -1389,6 +1390,7 @@ static void unmap_region(struct mm_struc unsigned long nr_accounted = 0; lru_add_drain();+ ioproc_invalidate_range(vma, start, end); tlb = tlb_gather_mmu(mm, 0); unmap_vmas(&tlb, mm, vma, start, end, &nr_accounted, NULL); vm_unacct_memory(nr_accounted);@@ -1713,6 +1715,7 @@ void exit_mmap(struct mm_struct *mm) spin_lock(&mm->page_table_lock); + ioproc_release(mm); tlb = tlb_gather_mmu(mm, 1); flush_cache_mm(mm); /* Use ~0UL here to ensure all VMAs in the mm are unmapped */Index: LINUX-SRC-TREE/mm/mprotect.c===================================================================--- LINUX-SRC-TREE.orig/mm/mprotect.c+++ LINUX-SRC-TREE/mm/mprotect.c@@ -10,6 +10,7 @@ #include <linux/mm.h> #include <linux/hugetlb.h>+#include <linux/ioproc.h> #include <linux/slab.h> #include <linux/shm.h> #include <linux/mman.h>@@ -101,6 +102,7 @@ change_protection(struct vm_area_struct if (start >= end) BUG(); spin_lock(¤t->mm->page_table_lock);+ ioproc_change_protection(vma, start, end, newprot); do { change_pmd_range(dir, start, end - start, newprot); start = (start + PGDIR_SIZE) & PGDIR_MASK;Index: LINUX-SRC-TREE/mm/mremap.c===================================================================--- LINUX-SRC-TREE.orig/mm/mremap.c+++ LINUX-SRC-TREE/mm/mremap.c@@ -9,6 +9,7 @@ #include <linux/mm.h> #include <linux/hugetlb.h>+#include <linux/ioproc.h> #include <linux/slab.h> #include <linux/shm.h> #include <linux/mman.h>@@ -144,6 +145,8 @@ static int move_page_tables(struct vm_ar { unsigned long offset = len; + ioproc_invalidate_range(vma, old_addr, old_addr + len);+ ioproc_invalidate_range(vma, new_addr, new_addr + len); flush_cache_range(vma, old_addr, old_addr + len); /*Index: LINUX-SRC-TREE/mm/msync.c===================================================================--- LINUX-SRC-TREE.orig/mm/msync.c+++ LINUX-SRC-TREE/mm/msync.c@@ -12,6 +12,7 @@ #include <linux/mm.h> #include <linux/mman.h> #include <linux/hugetlb.h>+#include <linux/ioproc.h> #include <asm/pgtable.h> #include <asm/pgalloc.h>@@ -116,6 +117,7 @@ static int filemap_sync(struct vm_area_s if (address >= end) BUG();+ ioproc_sync_range(vma, address, end); do { error |= filemap_sync_pmd_range(dir, address, end, vma, flags); address = (address + PGDIR_SIZE) & PGDIR_MASK;Index: LINUX-SRC-TREE/mm/objrmap.c===================================================================--- LINUX-SRC-TREE.orig/mm/objrmap.c+++ LINUX-SRC-TREE/mm/objrmap.c@@ -29,6 +29,7 @@ #include <linux/swapops.h> #include <linux/objrmap.h> #include <linux/init.h>+#include <linux/ioproc.h> #include <asm/tlbflush.h> kmem_cache_t * anon_vma_cachep;@@ -393,6 +394,8 @@ unmap_pte_page(struct page * page, struc { pte_t pteval; + ioproc_invalidate_page(vma, address);+ flush_cache_page(vma, address); pteval = ptep_clear_flush(vma, address, pte);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -