On Fri, Mar 09, 2007 at 07:59:24PM -0800, [EMAIL PROTECTED] wrote:
> 
> 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.

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 <[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
_______________________________________________
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