[Devel] [PATCH 1/6] Define and use task_active_pid_ns() wrapper

sukadev at us.ibm.com sukadev at us.ibm.com
Thu Jul 12 23:03:17 PDT 2007


Pavel Emelianov [xemul at openvz.org] wrote:
| sukadev at us.ibm.com wrote:
| > Subject: [PATCH 1/6] Define and use task_active_pid_ns() wrapper
| > 
| > From: Sukadev Bhattiprolu <sukadev at us.ibm.com>
| > 
| > With multiple pid namespaces, a process is known by some pid_t in
| > every ancestor pid namespace.  Every time the process forks, the
| > child process also gets a pid_t in every ancestor pid namespace.
| > 
| > While a process is visible in >=1 pid namespaces, it can see pid_t's
| > in only one pid namespace.  We call this pid namespace it's "active
| > pid namespace", and it is always the youngest pid namespace in which
| > the process is known.
| > 
| > This patch defines and uses a wrapper to find the active pid namespace
| > of a process. The implementation of the wrapper will be changed in 
| > when support for multiple pid namespaces are added.
| > 
| > Changelog:
| > 	2.6.22-rc4-mm2-pidns1:
| > 	- [Pavel Emelianov, Alexey Dobriyan] Back out the change to use
| > 	  task_active_pid_ns() in child_reaper() since task->nsproxy
| > 	  can be NULL during task exit (so child_reaper() continues to
| > 	  use init_pid_ns).
| > 
| > 	  to implement child_reaper() since init_pid_ns.child_reaper to
| > 	  implement child_reaper() since tsk->nsproxy can be NULL during exit.
| > 
| > 	2.6.21-rc6-mm1:
| > 	- Rename task_pid_ns() to task_active_pid_ns() to reflect that a
| > 	  process can have multiple pid namespaces.
| > 
| > Signed-off-by: Sukadev Bhattiprolu <sukadev at us.ibm.com>
| 
| Acked-by: Pavel Emelianov <xemul at openvz.org>
| 
| But I'm not sure Andrew will like the construction like
| 
| some_function()->xxx;
| 
| I used to do so in memory controller, but he asked to fix...

Hmm. I see this in the code: 

	rcu_dereference(p->real_parent)->tgid

Maybe rcu_deref is a spl case. Well, if Andrew complains, I
will add local vars as needed. I think its easier to read
with a wrapper than expanded out.

Thanks,

Suka


More information about the Containers mailing list