From: Sukadev Bhattiprolu <sukadev@xxxxxxxxxx> Subject: [RFC][PATCH 05/14] Initialize struct pid_nr for swapper. Statically initialize a struct pid_nr for the swapper process. Signed-off-by: Sukadev Bhattiprolu <sukadev@xxxxxxxxxx> --- include/linux/init_task.h | 10 ++++++++++ kernel/pid.c | 1 + 2 files changed, 11 insertions(+) Index: 2.6.21-rc3-mm2/include/linux/init_task.h =================================================================== --- 2.6.21-rc3-mm2.orig/include/linux/init_task.h +++ 2.6.21-rc3-mm2/include/linux/init_task.h @@ -96,6 +96,15 @@ extern struct group_info init_groups; #define INIT_PREEMPT_RCU #endif +#define INIT_STRUCT_PID_NR { \ + .node = { .next = NULL, .pprev = NULL }, \ + .nr = 0, \ + /* Don't put this struct pid in pid_hash */ \ + .pid_chain = { .next = NULL, .pprev = NULL }, \ + .pid_ns = &init_pid_ns, \ + .pid = &init_struct_pid, \ +} + #define INIT_STRUCT_PID { \ .count = ATOMIC_INIT(1), \ .nr = 0, \ @@ -106,6 +115,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: 2.6.21-rc3-mm2/kernel/pid.c =================================================================== --- 2.6.21-rc3-mm2.orig/kernel/pid.c +++ 2.6.21-rc3-mm2/kernel/pid.c @@ -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@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/containers