[RFC][PATCH 0/5] Remove nsproxy->pid_ns

sukadev at us.ibm.com sukadev at us.ibm.com
Fri Mar 9 20:00:53 PST 2007


From: Sukadev Bhattiprolu <sukadev at us.ibm.com>
Subject [RFC][PATCH 0/5] Remove nsproxy->pid_ns

We need to decouple pid namespace from nsproxy to allow getting and
releasing pid namespace independently from other namespaces. This is
required since a process's reference to its pid namespace must exist
even after its references to other namespaces are dropped during
process exit.

This patchset accomplishes this by using the pid->pid_nrs list defined
in earlier patches. As noted from that patchset, pid->pid_nrs list
allows each process to have multiple pid_t values, one per each namespace.

We define a task's clone-pid-namespace as the pid namespace that the
process last unshared into. If the process never unshared its pid namespace,
then its clone-pid-namespace is same as its parent clone-pid-namespace
(possibly init-pid-ns), when the process was created.

When a process unshares its pid namespace, we allocate a new struct pid_nr
and attach this pid_nr at the head of the pid->pid_nrs list.

The task_pid_ns() wrapper always returns this clone-pid-ns of the task
and returns the pid namespace from the head of the pid->pid_nrs list.

This patch set includes following 5 patches:

[PATCH 1/5]
	Rename *namespaces() functions to *nsproxy() to reflect that
	these functions only operate on an nsproxy and not on all
	namespaces.

[PATCH 2/5]
	Define helper functions to use as we move pid namespace out of
	nsproxy 

[PATCH 3/5]
	Use pid_namespace in struct pid_nr rather than nsproxy->pid_ns.

[PATCH 4/5]
	Remove the struct pid_namespace * from struct nsproxy

[PATCH 5/5]
	Remove the now-unused function, copy_pid_ns().


Signed-off-by: Sukadev Bhattiprolu <sukadev at us.ibm.com>
Cc: Cedric Le Goater <clg at fr.ibm.com>
Cc: Dave Hansen <haveblue at us.ibm.com>
Cc: Serge Hallyn <serue at us.ibm.com>
Cc: containers at lists.osdl.org
---



More information about the Containers mailing list