[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081127011738.GC13545@wavehammer.waldi.eu.org>
Date: Thu, 27 Nov 2008 02:17:38 +0100
From: Bastian Blank <bastian@...di.eu.org>
To: Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
Cc: oleg@...hat.com, ebiederm@...ssion.com, roland@...hat.com,
containers@...ts.osdl.org, linux-kernel@...r.kernel.org,
xemul@...nvz.org
Subject: Re: [RFC][PATCH 2/5] pid: Generalize task_active_pid_ns
On Tue, Nov 25, 2008 at 07:45:28PM -0800, Sukadev Bhattiprolu wrote:
> Currently task_active_pid_ns is not safe to call after a
> task becomes a zombie and exit_task_namespaces is called,
> as nsproxy becomes NULL.
Why do you need to be able to get the pid namespace from zombie
processes? Also according to nsproxy.h this access variant is only
allowed for the current task, anything else needs to take a rcu lock.
> By reading the pid namespace from
> the pid of the task we can trivially solve this problem at
> the cost of one extra memory read in what should be the
> same cacheline as we read the namespace from.
The pid namespace may not be destructed yet?
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -1111,12 +1111,12 @@ static struct task_struct *copy_process(unsigned long clone_flags,
>
> if (pid != &init_struct_pid) {
> retval = -ENOMEM;
> - pid = alloc_pid(task_active_pid_ns(p));
> + pid = alloc_pid(p->nsproxy->pid_ns);
Why do you expand the old version of the function?
Bastian
--
Women professionals do tend to over-compensate.
-- Dr. Elizabeth Dehaver, "Where No Man Has Gone Before",
stardate 1312.9.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists