[Devel] [RFC][PATCH 4/6] Initialize struct pid_nr for swapper

sukadev at us.ibm.com sukadev at us.ibm.com
Fri Mar 9 19:59:24 PST 2007


From: Sukadev Bhattiprolu <sukadev at us.ibm.com>
Subject: [RFC][PATCH 4/6] Initialize struct pid_nr for swapper.

Statically initialize a struct pid_nr for the swapper process.

Signed-off-by: Sukadev Bhattiprolu <sukadev at us.ibm.com>
Cc: Cedric Le Goater <clg at fr.ibm.com>
Cc: Dave Hansen <haveblue at us.ibm.com>
Cc: Serge Hallyn <serue at us.ibm.com>
Cc: containers at lists.osdl.org
---
 include/linux/init_task.h |    7 +++++++
 kernel/pid.c              |    1 +
 2 files changed, 8 insertions(+)

Index: lx26-20-mm2b/include/linux/init_task.h
===================================================================
--- lx26-20-mm2b.orig/include/linux/init_task.h	2007-03-08 17:56:05.000000000 -0800
+++ lx26-20-mm2b/include/linux/init_task.h	2007-03-09 14:56:11.000000000 -0800
@@ -96,6 +96,12 @@ extern struct group_info init_groups;
 #define INIT_PREEMPT_RCU
 #endif
 
+#define INIT_STRUCT_PID_NR {						\
+	.node		= { .next = NULL, .pprev = NULL },		\
+	.nr		= 0,						\
+	.pid_ns		= &init_pid_ns,					\
+}
+
 #define INIT_STRUCT_PID {						\
 	.count 		= ATOMIC_INIT(1),				\
 	.nr		= 0, 						\
@@ -106,6 +112,7 @@ extern struct group_info init_groups;
 		{ .first = &init_task.pids[PIDTYPE_PGID].node },	\
 		{ .first = &init_task.pids[PIDTYPE_SID].node },		\
 	},								\
+	.pid_nrs	= { .first = &init_struct_pid_nr.node },	\
 	.rcu		= RCU_HEAD_INIT,				\
 }
 
Index: lx26-20-mm2b/kernel/pid.c
===================================================================
--- lx26-20-mm2b.orig/kernel/pid.c	2007-03-08 17:56:57.000000000 -0800
+++ lx26-20-mm2b/kernel/pid.c	2007-03-09 14:56:33.000000000 -0800
@@ -34,6 +34,7 @@ static struct hlist_head *pid_hash;
 static int pidhash_shift;
 static struct kmem_cache *pid_cachep;
 static struct kmem_cache *pid_nr_cachep;
+struct pid_nr init_struct_pid_nr = INIT_STRUCT_PID_NR;
 struct pid init_struct_pid = INIT_STRUCT_PID;
 
 int pid_max = PID_MAX_DEFAULT;
_______________________________________________
Containers mailing list
Containers at lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers




More information about the Devel mailing list