From: Sukadev Bhattiprolu <[EMAIL PROTECTED]>
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 <[EMAIL PROTECTED]>
Cc: Cedric Le Goater <[EMAIL PROTECTED]>
Cc: Dave Hansen <[EMAIL PROTECTED]>
Cc: Serge Hallyn <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED]
---
 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
[EMAIL PROTECTED]
https://lists.osdl.org/mailman/listinfo/containers

_______________________________________________
Devel mailing list
[email protected]
https://openvz.org/mailman/listinfo/devel

Reply via email to