📄 qsnet-rhel4-2.6.patch
字号:
Index: linux-269-5502/fs/open.c===================================================================--- linux-269-5502.orig/fs/open.c+++ linux-269-5502/fs/open.c@@ -1029,6 +1029,8 @@ out_error: goto out; } +EXPORT_SYMBOL(sys_open);+ #ifndef __alpha__ /*Index: linux-269-5502/fs/read_write.c===================================================================--- linux-269-5502.orig/fs/read_write.c+++ linux-269-5502/fs/read_write.c@@ -145,6 +145,7 @@ asmlinkage off_t sys_lseek(unsigned int bad: return retval; }+EXPORT_SYMBOL(sys_lseek); #ifdef __ARCH_WANT_SYS_LLSEEK asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high,Index: linux-269-5502/fs/select.c===================================================================--- linux-269-5502.orig/fs/select.c+++ linux-269-5502/fs/select.c@@ -539,3 +539,4 @@ out_fds: poll_freewait(&table); return err; }+EXPORT_SYMBOL_GPL(sys_poll);Index: linux-269-5502/fs/exec.c===================================================================--- linux-269-5502.orig/fs/exec.c+++ linux-269-5502/fs/exec.c@@ -56,6 +56,8 @@ #include <linux/kmod.h> #endif +#include <linux/ptrack.h>+ int core_uses_pid; char core_pattern[65] = "core"; int suid_dumpable = 0;@@ -1214,6 +1216,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) { free_arg_pages(bprm);Index: linux-269-5502/arch/i386/Kconfig===================================================================--- linux-269-5502.orig/arch/i386/Kconfig+++ linux-269-5502/arch/i386/Kconfig@@ -960,6 +960,9 @@ config REGPARM generate incorrect output with certain kernel constructs when -mregparm=3 is used. +source "mm/Kconfig"+source "kernel/Kconfig"+ endmenu Index: linux-269-5502/arch/i386/defconfig===================================================================--- linux-269-5502.orig/arch/i386/defconfig+++ linux-269-5502/arch/i386/defconfig@@ -119,6 +119,8 @@ CONFIG_MTRR=y CONFIG_IRQBALANCE=y CONFIG_HAVE_DEC_LOCK=y # CONFIG_REGPARM is not set+CONFIG_IOPROC=y+CONFIG_PTRACK=y # # Power management options (ACPI, APM)Index: linux-269-5502/arch/ia64/Kconfig===================================================================--- linux-269-5502.orig/arch/ia64/Kconfig+++ linux-269-5502/arch/ia64/Kconfig@@ -316,6 +316,9 @@ config IA64_PALINFO To use this option, you have to ensure that the "/proc file system support" (CONFIG_PROC_FS) is enabled, too. +source "mm/Kconfig"+source "kernel/Kconfig"+ source "drivers/firmware/Kconfig" source "fs/Kconfig.binfmt"Index: linux-269-5502/arch/ia64/defconfig===================================================================--- linux-269-5502.orig/arch/ia64/defconfig+++ linux-269-5502/arch/ia64/defconfig@@ -83,6 +83,8 @@ CONFIG_IA32_SUPPORT=y CONFIG_COMPAT=y CONFIG_PERFMON=y CONFIG_IA64_PALINFO=y+CONFIG_IOPROC=y+CONFIG_PTRACK=y # # Firmware DriversIndex: linux-269-5502/arch/x86_64/Kconfig===================================================================--- linux-269-5502.orig/arch/x86_64/Kconfig+++ linux-269-5502/arch/x86_64/Kconfig@@ -401,6 +401,9 @@ config X86_MCE_AMD Additional support for AMD specific MCE features such as the DRAM Error Threshold. +source "mm/Kconfig"+source "kernel/Kconfig"+ endmenu Index: linux-269-5502/arch/x86_64/defconfig===================================================================--- linux-269-5502.orig/arch/x86_64/defconfig+++ linux-269-5502/arch/x86_64/defconfig@@ -87,6 +87,8 @@ CONFIG_NR_CPUS=8 CONFIG_GART_IOMMU=y CONFIG_SWIOTLB=y CONFIG_X86_MCE=y+CONFIG_IOPROC=y+CONFIG_PTRACK=y # # Power management optionsIndex: linux-269-5502/kernel/ptrack.c===================================================================--- /dev/null+++ linux-269-5502/kernel/ptrack.c@@ -0,0 +1,145 @@+/*+ * 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.+ */+++#include <linux/module.h>+#include <linux/spinlock.h>+#include <linux/sched.h>+#include <linux/ptrack.h>+#include <linux/slab.h>+#include <linux/list.h>++#include <asm/errno.h>++int+ptrack_register (ptrack_callback_t callback, void *arg)+{+ struct ptrack_desc *desc = kmalloc (sizeof (struct ptrack_desc), GFP_KERNEL);+ + if (desc == NULL)+ return -ENOMEM;++ desc->callback = callback;+ desc->arg = arg;+ + list_add_tail (&desc->link, ¤t->ptrack_list);+ + return 0;+}++void+ptrack_deregister (ptrack_callback_t callback, void *arg)+{ + struct list_head *el, *nel;+ + list_for_each_safe (el, nel, ¤t->ptrack_list) {+ struct ptrack_desc *desc = list_entry (el, struct ptrack_desc, link);+ + if (desc->callback == callback && desc->arg == arg) {+ list_del (&desc->link);+ kfree (desc);+ }+ }+}++int+ptrack_registered (ptrack_callback_t callback, void *arg)+{+ struct list_head *el;+ + list_for_each (el, ¤t->ptrack_list) {+ struct ptrack_desc *desc = list_entry (el, struct ptrack_desc, link);+ + if (desc->callback == callback && desc->arg == arg)+ return 1;+ }+ return 0;+} + +int+ptrack_call_callbacks (int phase, struct task_struct *child)+{+ struct list_head *el, *nel;+ struct ptrack_desc *new;+ int res;++ 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-269-5502/kernel/signal.c===================================================================--- linux-269-5502.orig/kernel/signal.c+++ linux-269-5502/kernel/signal.c@@ -2329,6 +2329,7 @@ sys_kill(int pid, int sig) return kill_something_info(sig, &info, pid); }+EXPORT_SYMBOL_GPL(sys_kill); /** * sys_tgkill - send signal to one specific threadIndex: linux-269-5502/kernel/Kconfig===================================================================--- /dev/null+++ linux-269-5502/kernel/Kconfig@@ -0,0 +1,14 @@+#+# Kernel subsystem specific config+# ++# Support for Process Tracking callbacks+#+config PTRACK+ bool "Enable PTRACK process tracking hooks"+ default y+ help+ This option enables hooks to be called when processes are+ created and destoryed in order for a resource management + system to know which processes are a member of a "job" and + to be able to clean up when the job is terminated.Index: linux-269-5502/kernel/Makefile===================================================================--- linux-269-5502.orig/kernel/Makefile+++ linux-269-5502/kernel/Makefile@@ -26,6 +26,7 @@ obj-$(CONFIG_AUDIT) += audit.o obj-$(CONFIG_AUDITSYSCALL) += auditsc.o obj-$(CONFIG_AUDITFILESYSTEM) += auditfs.o obj-$(CONFIG_KPROBES) += kprobes.o+obj-$(CONFIG_PTRACK) += ptrack.o ifneq ($(CONFIG_IA64),y) # According to Alan Modra <alan@linuxcare.com.au>, the -fno-omit-frame-pointer isIndex: linux-269-5502/kernel/exit.c===================================================================--- linux-269-5502.orig/kernel/exit.c+++ linux-269-5502/kernel/exit.c@@ -32,6 +32,8 @@ #include <asm/pgtable.h> #include <asm/mmu_context.h> +#include <linux/ptrack.h>+ extern void sem_exit (void); extern struct task_struct *child_reaper; @@ -825,6 +827,9 @@ asmlinkage NORET_TYPE void do_exit(long current->tux_exit(); } + /* Notify any ptrack callbacks of the process exit */+ ptrack_call_callbacks(PTRACK_PHASE_EXIT, NULL);+ if (unlikely(tsk->audit_context)) audit_free(tsk); __exit_mm(tsk);Index: linux-269-5502/kernel/fork.c===================================================================--- linux-269-5502.orig/kernel/fork.c+++ linux-269-5502/kernel/fork.c@@ -14,6 +14,7 @@ #include <linux/config.h> #include <linux/slab.h> #include <linux/init.h>+#include <linux/ptrack.h> #include <linux/unistd.h> #include <linux/smp_lock.h> #include <linux/module.h>@@ -443,6 +444,9 @@ static struct mm_struct * mm_init(struct mm->page_table_lock = SPIN_LOCK_UNLOCKED; mm->ioctx_list_lock = RW_LOCK_UNLOCKED; mm->ioctx_list = NULL;+#ifdef CONFIG_IOPROC+ mm->ioproc_ops = NULL;+#endif mm->default_kioctx = (struct kioctx)INIT_KIOCTX(mm->default_kioctx, *mm); mm->free_area_cache = TASK_UNMAPPED_BASE; @@ -1312,6 +1316,11 @@ long do_fork(unsigned long clone_flags, set_tsk_thread_flag(p, TIF_SIGPENDING); } + if (ptrack_call_callbacks(PTRACK_PHASE_CLONE, p)) {+ sigaddset(&p->pending.signal, SIGKILL);+ set_tsk_thread_flag(p, TIF_SIGPENDING);+ }+ if (!(clone_flags & CLONE_STOPPED)) wake_up_new_task(p, clone_flags); elseIndex: linux-269-5502/Makefile===================================================================--- linux-269-5502.orig/Makefile+++ linux-269-5502/Makefile@@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 9-EXTRAVERSION = -prep+EXTRAVERSION = -prep.qp3.5.34.4qsnet RHEL_VERSION = 4 RHEL_UPDATE = 5 NAME=AC 1Index: linux-269-5502/Documentation/vm/ioproc.txt===================================================================--- /dev/null+++ linux-269-5502/Documentation/vm/ioproc.txt@@ -0,0 +1,467 @@+Linux IOPROC patch overview+===========================++The network interface for an HPC network differs significantly from+network interfaces for traditional IP networks. HPC networks tend to+be used directly from user processes and perform large RDMA transfers+between theses processes address space. They also have a requirement+for low latency communication, and typically achieve this by OS bypass+techniques. This then requires a different model to traditional+interconnects, in that a process may need to expose a large amount of+it's address space to the network RDMA.++Locking down of memory has been a common mechanism for performing+this, together with a pin-down cache implemented in user+libraries. The disadvantage of this method is that large portions of+the physical memory can be locked down for a single process, even if+it's working set changes over the different phases of it's+execution. This leads to inefficient memory utilisation - akin to the+disadvantage of swapping compared to paging.++This model also has problems where memory is being dynamically+allocated and freed, since the pin down cache is unaware that memory+may have been released by a call to munmap() and so it will still be+locking down the now unused pages.++Some modern HPC network interfaces implement their own MMU and are+able to handle a translation fault during a network access. The+Quadrics (http://www.quadrics.com) devices (Elan3 and Elan4) have done+this for some time and we expect others to follow the same route in+the relatively near future. These NICs are able to operate in an
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -