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

Herbert Poetzl herbert at 13thfloor.at
Sat Mar 10 14:09:08 PST 2007


On Fri, Mar 09, 2007 at 07:59:24PM -0800, sukadev at us.ibm.com wrote:
> 
> 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.

does that actually satisfy procfs needs too, or
just the abstract internal references?

because if it is enough to make procfs happy, this
would be a viable solution for the lightweight guest
case (as fake init process) too, which doesn't require
a blend through functionality anymore, and would allow
to make the pid isolation complete without wasting
any resources ...

TIA,
Herbert

> 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
_______________________________________________
Containers mailing list
Containers at lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers




More information about the Devel mailing list