Home » Mailing lists » Devel » [RFC][PATCH 0/16] Enable cloning of pid namespace
| Re: [RFC][PATCH 07/16] Move alloc_pid call to copy_process [message #18640 is a reply to message #18616] |
Thu, 24 May 2007 09:42   |
Sukadev Bhattiprolu
Messages: 413 Registered: August 2006
|
Senior Member |
|
|
Pavel Emelianov [xemul@sw.ru] wrote:
| sukadev@us.ibm.com wrote:
| > Pavel Emelianov [xemul@sw.ru] wrote:
| > | > Index: lx26-21-mm2/kernel/pid.c
| > | > ===================================================================
| > | > --- lx26-21-mm2.orig/kernel/pid.c 2007-05-22 16:59:46.000000000 -0700
| > | > +++ lx26-21-mm2/kernel/pid.c 2007-05-22 17:06:48.000000000 -0700
| > | > @@ -216,6 +216,10 @@ fastcall void free_pid(struct pid *pid)
| > | > /* We can be called with write_lock_irq(&tasklist_lock) held */
| > | > unsigned long flags;
| > | >
| > | > + /* check this here to keep copy_process() cleaner */
| > | > + if (unlikely(pid == &init_struct_pid))
| > | > + return;
| > | > +
| > |
| > | This looks ugly to me.
| >
| > I agree about the ugly part :-) but we need to distinguish
| > between idle thread and normal thread at some point in do_fork().
|
| Why not keep this as it was - pass the pid from do_fork() or
| do_fork_idle(). Why is that bad?
When CLONE_NEWPID flag is specified and we create a new pid ns
we need the task_struct that will become the child reaper for
the new ns. The task_struct is allocated in copy_process().
We could make a second check for CLONE_NEWPID in copy_process()
and then initialize the reaper for the ns, but that could have
same or more performance impact ?
|
| > | That's the same as if we put
| > | if (ns == &init_pid_ns)
| > | return;
| > | in put_pid_ns() call.
| > |
| > | Such small struts of their own do not introduce any noticeable
| > | effect, but when we have them in many places (and on fast patsh
| > | like alloc_pid()) the performance hurts...
| >
| > I agree and we have been trying to keep the impact as low as possible.
|
| In this patches - yes. But when we have many patches with sucn
| "hooks" this becomes noticeable and hard to debug.
|
| > |
| > |
| > | > spin_lock_irqsave(&pidmap_lock, flags);
| > | > hlist_del_rcu(&pid->pid_chain);
| > | > spin_unlock_irqrestore(&pidmap_lock, flags);
| > | > @@ -224,12 +228,16 @@ fastcall void free_pid(struct pid *pid)
| > | > call_rcu(&pid->rcu, delayed_put_pid);
| > | > }
| > | >
| > | > -struct pid *alloc_pid(void)
| > | > +struct pid *alloc_pid(enum copy_process_type copy_src)
| > | > {
| > | > struct pid *pid;
| > | > enum pid_type type;
| > | > int nr = -1;
| > | >
| > | > + /* check this here to keep copy_process() cleaner */
| > | > + if (unlikely(copy_src == COPY_IDLE_PROCESS))
| > | > + return &init_struct_pid;
| > | > +
| > | > pid = kmem_cache_alloc(pid_cachep, GFP_KERNEL);
| > | > if (!pid)
| > | > goto out;
| > | > _______________________________________________
| > | > Containers mailing list
| > | > Containers@lists.linux-foundation.org
| > | > https://lists.linux-foundation.org/mailman/listinfo/containers
| > | >
| > | > _______________________________________________
| > | > Devel mailing list
| > | > Devel@openvz.org
| > | > https://openvz.org/mailman/listinfo/devel
| > | >
| >
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
|
|
|
|
 |
|
[RFC][PATCH 0/16] Enable cloning of pid namespace
|
 |
|
[RFC][PATCH 01/16] Define/use task_active_pid_ns() wrapper
|
 |
|
[RFC][PATCH 02/16] Rename pid_nr function
|
 |
|
[RFC][PATCH 03/16] Rename child_reaper function
|
 |
|
[RFC][PATCH 04/16] Use pid_to_nr() in process info functions
|
 |
|
Re: [RFC][PATCH 04/16] Use pid_to_nr() in process info functions
By: xemul on Thu, 24 May 2007 08:22
|
 |
|
Re: [RFC][PATCH 04/16] Use pid_to_nr() in process info functions
|
 |
|
[RFC][PATCH 05/16] Use task_pid() to find leader's pid
|
 |
|
[RFC][PATCH 06/16] Define is_global_init()
|
 |
|
Re: [RFC][PATCH 06/16] Define is_global_init()
|
 |
|
Re: [RFC][PATCH 06/16] Define is_global_init()
By: xemul on Thu, 24 May 2007 09:24
|
 |
|
Re: [RFC][PATCH 06/16] Define is_global_init()
|
 |
|
Re: [RFC][PATCH 06/16] Define is_global_init()
|
 |
|
Re: [RFC][PATCH 06/16] Define is_global_init()
|
 |
|
Re: [RFC][PATCH 06/16] Define is_global_init()
|
 |
|
Re: [RFC][PATCH 06/16] Define is_global_init()
|
 |
|
Re: [RFC][PATCH 06/16] Define is_global_init()
By: serue on Thu, 24 May 2007 15:27
|
 |
|
Re: [RFC][PATCH 06/16] Define is_global_init()
By: xemul on Thu, 24 May 2007 08:28
|
 |
|
Re: [RFC][PATCH 06/16] Define is_global_init()
By: xemul on Thu, 24 May 2007 08:29
|
 |
|
Re: [RFC][PATCH 06/16] Define is_global_init()
|
 |
|
[RFC][PATCH 07/16] Move alloc_pid call to copy_process
|
 |
|
Re: [RFC][PATCH 07/16] Move alloc_pid call to copy_process
|
 |
|
Re: [RFC][PATCH 07/16] Move alloc_pid call to copy_process
By: xemul on Thu, 24 May 2007 09:30
|
 |
|
Re: [RFC][PATCH 07/16] Move alloc_pid call to copy_process
|
 |
|
Re: [RFC][PATCH 07/16] Move alloc_pid call to copy_process
By: xemul on Thu, 24 May 2007 08:35
|
 |
|
Re: [RFC][PATCH 07/16] Move alloc_pid call to copy_process
|
 |
|
Re: [RFC][PATCH 07/16] Move alloc_pid call to copy_process
|
 |
|
[RFC][PATCH 08/16] Define/use pid->upid_list list.
|
 |
|
Re: [RFC][PATCH 08/16] Define/use pid->upid_list list.
|
 |
|
Re: [RFC][PATCH 08/16] Define/use pid->upid_list list.
By: xemul on Thu, 24 May 2007 08:57
|
 |
|
[RFC][PATCH 09/16] Use pid ns from pid->upid_list
|
 |
|
[RFC][PATCH 10/16] Define CLONE_NEWPID flag
|
 |
|
[RFC][PATCH 11/16] Enable cloning pid namespace
|
 |
|
Re: [RFC][PATCH 11/16] Enable cloning pid namespace
By: serue on Thu, 24 May 2007 14:59
|
 |
|
[RFC][PATCH 12/16] Terminate processes in a ns when reaper is exiting.
|
 |
|
[RFC][PATCH 13/16] Remove proc_mnt's use for killing inodes
|
 |
|
[RFC][PATCH 14/16] Introduce proc_mnt for pid_ns
|
 |
|
Re: [RFC][PATCH 14/16] Introduce proc_mnt for pid_ns
|
 |
|
Re: [RFC][PATCH 14/16] Introduce proc_mnt for pid_ns
|
 |
|
Re: [RFC][PATCH 14/16] Introduce proc_mnt for pid_ns
By: xemul on Thu, 24 May 2007 09:23
|
 |
|
Re: [RFC][PATCH 14/16] Introduce proc_mnt for pid_ns
By: xemul on Thu, 24 May 2007 10:15
|
 |
|
Re: [RFC][PATCH 14/16] Introduce proc_mnt for pid_ns
|
 |
|
Re: [RFC][PATCH 14/16] Introduce proc_mnt for pid_ns
|
 |
|
Re: [RFC][PATCH 14/16] Introduce proc_mnt for pid_ns
|
 |
|
Re: [RFC][PATCH 14/16] Introduce proc_mnt for pid_ns
|
 |
|
[RFC][PATCH 15/16] Enable signaling child reaper from parent ns.
|
 |
|
Re: [RFC][PATCH 15/16] Enable signaling child reaper from parent ns.
By: serue on Thu, 24 May 2007 15:59
|
 |
|
Re: [RFC][PATCH 15/16] Enable signaling child reaper from parent ns.
|
 |
|
Re: [RFC][PATCH 15/16] Enable signaling child reaper from parent ns.
By: serue on Fri, 25 May 2007 20:13
|
 |
|
Re: [RFC][PATCH 15/16] Enable signaling child reaper from parent ns.
|
 |
|
Re: [RFC][PATCH 15/16] Enable signaling child reaper from parent ns.
|
 |
|
[RFC][PATCH 16/16] Move inline functions to sched.h
|
 |
|
Re: [RFC][PATCH 0/16] Enable cloning of pid namespace
|
 |
|
Re: [RFC][PATCH 0/16] Enable cloning of pid namespace
By: xemul on Thu, 24 May 2007 09:31
|
 |
|
Re: [RFC][PATCH 0/16] Enable cloning of pid namespace
|
 |
|
Re: [RFC][PATCH 0/16] Enable cloning of pid namespace
|
 |
|
Re: [RFC][PATCH 0/16] Enable cloning of pid namespace
|
Goto Forum:
Current Time: Mon Oct 27 12:16:45 GMT 2025
Total time taken to generate the page: 0.14929 seconds
|