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

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

 



Pavel Emelianov [xemul@xxxxxxxxxx] wrote:
| sukadev@xxxxxxxxxx wrote:
| > Subject: [PATCH 1/6] Define and use task_active_pid_ns() wrapper
| > 
| > From: Sukadev Bhattiprolu <sukadev@xxxxxxxxxx>
| > 
| > 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@xxxxxxxxxx>
| 
| Acked-by: Pavel Emelianov <xemul@xxxxxxxxxx>
| 
| 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
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.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