Skip to contentSkip to conversation

2.4.2 -- Process Aggregates

PATCH New Sam Watters 1 participant 1 message Mar 8, 2001

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.4.2 -- Process Aggregates

Applies against the 2.4.2 kernel and supports i386 and ia64 systems.

This patch provides the ability to register support for generic process groups. It does this by adding and entry in the task_struct to maintain a list of pagg (process aggregate) group attachments (or memberships). In addition, there are interfaces for modules to register as providing support for types of process aggregates. Changes were made to the fork and exit system calls so that child processes inherits group memberships from the parent process.

PAGG features:

- Child inherits attachment to the same PAGG
containers as the parent.

- PAGG Containers are updated when new processes are attached (eg. during process forks).

- PAGG Containers are updated when a process is
detached (eg. when a process exits).

- System call for controlling linux kernel modules that implement PAGG containers.

Another patch will follow that implements a job container using this pagg interface. The title for that patch will be: "[PATCH] 2.4.2 -- Linux Jobs". Since the pagg patch provides a generic feature, and jobs is just one implementation using that feature, the code was split into two patches. The pagg patch is useful by itself and does not require the job patch.

This work was done so that we could provide a job accounting package (called CSA).

For additional information about process aggregates & jobs, please go to the home page at:

http://oss.sgi.com/projects/pagg

At this site you can download these patches and the commands package (in RPM or tarball format). Also, there are additional patches for other 2.4.x kernels.

For additional information about CSA job accounting, please consult the home page at:

http://oss.sgicom/projects/csa

patch follows (linux-2.4.2-pagg.patch):
---------------------------------------------------------------
diff -Naur linux-2.4.2/Documentation/Configure.help linux-2.4.2-pagg/Documentation/Configure.help

Documentation/Configure.help +8 -0
@@ -14648,6 +14648,14 @@
   keys are documented in Documentation/sysrq.txt. Don't say Y unless
   you really know what this hack does.
 
+Process Aggregates support
+CONFIG_PAGG
+  Say Y here if you will be loading modules which provide support
+  for process aggregate containers.  Currently, this option is only
+  applicable to Intel (i386) architectures. Examples of such modules
+  include the Linux Jobs module and the Linux Array Sessions module.
+  If you will not be using such modules, say N.
+
 ISDN subsystem
 CONFIG_ISDN
   ISDN ("Integrated Services Digital Networks", called RNIS in France)

diff -Naur linux-2.4.2/Documentation/pagg.txt
linux-2.4.2-pagg/Documentation/pagg.txt

Documentation/pagg.txt +253 -0

253 lines not on this page · raw message

arch/i386/config.in +1 -0
diff -Naur linux-2.4.2/arch/i386/config.in linux-2.4.2-pagg/arch/i386/config.in
@@ -218,6 +218,7 @@
 bool 'System V IPC' CONFIG_SYSVIPC
 bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT
 bool 'Sysctl support' CONFIG_SYSCTL
+bool 'Support for process aggregates (PAGGs)' CONFIG_PAGG
 if [ "$CONFIG_PROC_FS" = "y" ]; then
    choice 'Kernel core (/proc/kcore) format' \
 	"ELF		CONFIG_KCORE_ELF	\

diff -Naur linux-2.4.2/arch/i386/kernel/entry.S
linux-2.4.2-pagg/arch/i386/kernel/entry.S

arch/i386/kernel/entry.S +6 -0
@@ -646,6 +646,12 @@
 	.long SYMBOL_NAME(sys_getdents64)	/* 220 */
 	.long SYMBOL_NAME(sys_fcntl64)
 	.long SYMBOL_NAME(sys_ni_syscall)	/* reserved for TUX */
+#if defined(CONFIG_PAGG)
+	.long SYMBOL_NAME(sys_paggctl)
+#else
+	.long SYMBOL_NAME(sys_ni_syscall)
+#endif
+
 
 	/*
 	 * NOTE!! This doesn't have to be exact - we just have
arch/ia64/config.in +1 -0
diff -Naur linux-2.4.2/arch/ia64/config.in linux-2.4.2-pagg/arch/ia64/config.in
@@ -93,6 +93,7 @@
 bool 'System V IPC' CONFIG_SYSVIPC
 bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT
 bool 'Sysctl support' CONFIG_SYSCTL
+bool 'Support for process aggregates (PAGGs)' CONFIG_PAGG
 tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
 tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
 

diff -Naur linux-2.4.2/arch/ia64/kernel/entry.S
linux-2.4.2-pagg/arch/ia64/kernel/entry.S

arch/ia64/kernel/entry.S +4 -0
@@ -1247,7 +1247,11 @@
 	data8 sys_newfstat
 	data8 sys_clone2
 	data8 sys_getdents64
+#if defined(CONFIG_PAGG)
+	data8 sys_paggctl			// 1215
+#else
 	data8 ia64_ni_syscall			// 1215
+#endif
 	data8 ia64_ni_syscall
 	data8 ia64_ni_syscall
 	data8 ia64_ni_syscall

diff -Naur linux-2.4.2/include/asm-i386/unistd.h
linux-2.4.2-pagg/include/asm-i386/unistd.h

include/asm-i386/unistd.h +5 -0
@@ -227,6 +227,11 @@
 #define __NR_madvise1		219	/* delete when C lib stub is removed */
 #define __NR_getdents64		220
 #define __NR_fcntl64		221
+#if defined(CONFIG_PAGG)
+#define __NR_paggctl          	223 
+#endif
+
+
 
 /* user-visible error numbers are in the range -1 - -124: see

<asm-i386/errno.h> */

diff -Naur linux-2.4.2/include/asm-ia64/unistd.h
linux-2.4.2-pagg/include/asm-ia64/unistd.h

include/asm-ia64/unistd.h +5 -0
@@ -204,6 +204,11 @@
 #define __NR_fstat			1212
 #define __NR_clone2			1213
 #define __NR_getdents64			1214
+#if defined(CONFIG_PAGG)
+#define __NR_paggctl			1215
+#endif
+
+
 
 #if !defined(__ASSEMBLY__) && !defined(ASSEMBLER)
 

diff -Naur linux-2.4.2/include/linux/pagg.h
linux-2.4.2-pagg/include/linux/pagg.h

include/linux/pagg.h +180 -0

180 lines not on this page · raw message

diff -Naur linux-2.4.2/include/linux/paggctl.h
linux-2.4.2-pagg/include/linux/paggctl.h

include/linux/paggctl.h +51 -0

51 lines not on this page · raw message

diff -Naur linux-2.4.2/include/linux/sched.h
linux-2.4.2-pagg/include/linux/sched.h

include/linux/sched.h +5 -0
@@ -26,6 +26,7 @@
 #include <linux/signal.h>
 #include <linux/securebits.h>
 #include <linux/fs_struct.h>
+#include <linux/pagg.h>
 
 /*
  * cloning flags:
@@ -395,6 +396,10 @@
    	u32 self_exec_id;
 /* Protection of (de-)allocation: mm, files, fs, tty */
 	spinlock_t alloc_lock;
+#if defined(CONFIG_PAGG)
+/* List of pagg (process aggregate) attachments */
+	struct list_head pagg_list;
+#endif
 };
 
 /*
kernel/Makefile +1 -0
diff -Naur linux-2.4.2/kernel/Makefile linux-2.4.2-pagg/kernel/Makefile
@@ -12,6 +12,7 @@
 export-objs = signal.o sys.o kmod.o context.o ksyms.o pm.o
 
 obj-y     = sched.o dma.o fork.o exec_domain.o panic.o printk.o \
+	    pagg.o \
 	    module.o exit.o itimer.o info.o time.o softirq.o resource.o \
 	    sysctl.o acct.o capability.o ptrace.o timer.o user.o \
 	    signal.o sys.o kmod.o context.o
kernel/exit.c +12 -0
diff -Naur linux-2.4.2/kernel/exit.c linux-2.4.2-pagg/kernel/exit.c
@@ -10,6 +10,7 @@
 #include <linux/smp_lock.h>
 #include <linux/module.h>
 #include <linux/tty.h>
+#include <linux/pagg.h>
 #ifdef CONFIG_BSD_PROCESS_ACCT
 #include <linux/acct.h>
 #endif
@@ -454,6 +455,17 @@
 
 	tsk->exit_code = code;
 	exit_notify();
+
+	/*
+	 * If config'd for PAGG support:
+	 *      call pagg modules to detach 
+	 *      from process aggregates to which the current process is 
+	 *      attached.
+	 * Else
+	 *      This is a no-op.
+	 */
+	detach_pagg_chk(tsk);
+ 
 	schedule();
 	BUG();
 /*
kernel/fork.c +12 -0
diff -Naur linux-2.4.2/kernel/fork.c linux-2.4.2-pagg/kernel/fork.c
@@ -18,6 +18,7 @@
 #include <linux/smp_lock.h>
 #include <linux/module.h>
 #include <linux/vmalloc.h>
+#include <linux/pagg.h>
 
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
@@ -660,6 +661,16 @@
 	   
 	p->parent_exec_id = p->self_exec_id;
 
+	/*
+	 * If config'd for PAGG support:
+	 *      call pagg modules to properly attach new process
+	 *      to the same process aggregate containers as the 
+	 *      parent process.
+	 * Else
+	 *      this is a no-op.
+	 */
+	attach_pagg_chk(current, p);
+
 	/* ok, now we should be set up.. */
 	p->swappable = 1;
 	p->exit_signal = clone_flags & CSIGNAL;
@@ -713,6 +724,7 @@
 bad_fork_cleanup_files:
 	exit_files(p); /* blocking */
 bad_fork_cleanup:
+	detach_pagg_chk(p);	/* no-op unless CONFIG_PAGG=y  */
 	put_exec_domain(p->exec_domain);
 	if (p->binfmt && p->binfmt->module)
 		__MOD_DEC_USE_COUNT(p->binfmt->module);
kernel/ksyms.c +9 -0
diff -Naur linux-2.4.2/kernel/ksyms.c linux-2.4.2-pagg/kernel/ksyms.c
@@ -46,6 +46,7 @@
 #include <linux/brlock.h>
 #include <linux/fs.h>
 #include <linux/tty.h>
+#include <linux/pagg.h>
 
 #if defined(CONFIG_PROC_FS)
 #include <linux/proc_fs.h>
@@ -474,6 +475,14 @@
 
 /* Miscellaneous access points */
 EXPORT_SYMBOL(si_meminfo);
+#if defined(CONFIG_PAGG)
+EXPORT_SYMBOL(find_pagg);
+EXPORT_SYMBOL(register_pagg);
+EXPORT_SYMBOL(unregister_pagg);
+EXPORT_SYMBOL(attach_pagg);
+EXPORT_SYMBOL(detach_pagg);
+#endif
+
 
 /* Added to make file system as module */
 EXPORT_SYMBOL(sys_tz);
kernel/pagg.c +426 -0

426 lines not on this page · raw message