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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 09, 2007 at 07:59:24PM -0800, sukadev@xxxxxxxxxx wrote:
> 
> From: Sukadev Bhattiprolu <sukadev@xxxxxxxxxx>
> 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@xxxxxxxxxx>
> Cc: Cedric Le Goater <clg@xxxxxxxxxx>
> Cc: Dave Hansen <haveblue@xxxxxxxxxx>
> Cc: Serge Hallyn <serue@xxxxxxxxxx>
> Cc: containers@xxxxxxxxxxxxxx
> ---
>  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@xxxxxxxxxxxxxx
> https://lists.osdl.org/mailman/listinfo/containers
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxx
https://lists.osdl.org/mailman/listinfo/containers


[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux