[Devel] [PATCH 7/15] Helpers to obtain pid numbers

2007-07-26 Thread Pavel Emelyanov
When showing pid to user or getting the pid numerical id for in-kernel use the value of this id may differ depending on the namespace. This set of helpers is used to get the global pid nr, the virtual (i.e. seen by task in its namespace) nr and the nr as it is seen from the specified namespace.

[Devel] [PATCH 9/15] Move alloc_pid() after the namespace is cloned

2007-07-26 Thread Pavel Emelyanov
When we create new namespace we will need to allocate the struct pid, that will have one extra struct upid in array, comparing to the parent. Thus we need to know the new namespace (if any) in alloc_pid() to init this struct upid properly, so move the alloc_pid() call lower in copy_process().

[Devel] Re: [PATCH] Remove CTL_UNNUMBERED

2007-07-26 Thread Eric W. Biederman
Alexey Dobriyan [EMAIL PROTECTED] writes: CTL_UNNUMBERED is unneeded, because it expands to .ctl_name = 0 The same effect can be achieved by skipping .ctl_name initialization, saving one line per sysctl. Update docs and headers telling people to not add CTL_ numbers and giving

[Devel] Re: [PATCH 8/15] Helpers to find the task by its numerical ids

2007-07-26 Thread Dave Hansen
On Thu, 2007-07-26 at 18:51 +0400, Pavel Emelyanov wrote: +extern struct task_struct *find_task_by_pid_type_ns(int type, int pid, + struct pid_namespace *ns); + +#define find_task_by_pid_ns(nr, ns) \ + find_task_by_pid_type_ns(PIDTYPE_PID, nr, ns) +#define

[Devel] Re: [PATCH 1/15] Move exit_task_namespaces()

2007-07-26 Thread Dave Hansen
On Thu, 2007-07-26 at 18:46 +0400, Pavel Emelyanov wrote: + write_unlock_irq(tasklist_lock); + exit_task_namespaces(tsk); + write_lock_irq(tasklist_lock); Are there any other side-effects of doing this? What was the tasklist_lock protecting here when it was released? --

[Devel] [PATCH 14/15] Destroy pid namespace on init's death

2007-07-26 Thread Pavel Emelyanov
From: Sukadev Bhattiprolu [EMAIL PROTECTED] Terminate all processes in a namespace when the reaper of the namespace is exiting. We do this by walking the pidmap of the namespace and sending SIGKILL to all processes. Signed-off-by: Sukadev Bhattiprolu [EMAIL PROTECTED] Acked-by: Pavel Emelyanov

[Devel] [PATCH 13/15] Clone the pid namespace

2007-07-26 Thread Pavel Emelyanov
When clone() is invoked with CLONE_NEWPID, create a new pid namespace Since the active pid namespace is special and expected to be the first entry in pid-upid_list, preserve the order of pid namespaces. Pid namespaces can be nested and the nesting depth is unlimited. When a process clones its

[Devel] [PATCH 6/15] Make alloc_pid(), free_pid() and put_pid() work with struct upid

2007-07-26 Thread Pavel Emelyanov
Each struct upid element of struct pid has to be initialized properly, i.e. its nr mst be allocated from appropriate pidmap and it must be inserted into the hash. Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED] --- include/linux/pid.h |2 +- kernel/pid.c| 52

[Devel] [PATCH 5/15] Introduce struct upid

2007-07-26 Thread Pavel Emelyanov
From: Sukadev Bhattiprolu [EMAIL PROTECTED] Since task will be visible from different pid namespaces each of them have to be addressed by multiple pids. struct upid is to store the information about which id refers to which namespace. The constuciton looks like this. Each struct pid carried the

[Devel] [PATCH 4/15] Make proc_flust_task() flush entries from multiple proc trees

2007-07-26 Thread Pavel Emelyanov
Since a task will appear in more than one proc tree we need to shrink many trees. For this case we pass the struct pid to proc_flush_task() and shrink the mounts of all the namespaces this pid belongs to. The NULL passed to it means that only global mount is to be flushed. This is a preparation

[Devel] [RFC][PATCH 0/15] Pid namespaces

2007-07-26 Thread Pavel Emelyanov
(Comment is taken from Sukadev's patchset-v3) A pid namespace is a view of a particular set of tasks on the system. They work in a similar way to filesystem namespaces. A file (or a process) can be accessed in multiple namespaces, but it may have a different name in each. In a filesystem,

[Devel] [PATCH 1/2] mm: nonresident page tracking

2007-07-26 Thread Peter Zijlstra
From: Rik van Riel [EMAIL PROTECTED] Track non-resident pages through a simple hashing scheme. This way the space overhead is limited to 1 u32 per page, or 0.1% space overhead and lookups are one cache miss. Aside from seeing whether or not a page was recently evicted, we can also take a

[Devel] Re: [PATCH 1/15] Move exit_task_namespaces()

2007-07-26 Thread Kirill Korotaev
Oleg Nesterov wrote: On 07/26, Pavel Emelyanov wrote: Make task release its namespaces after it has reparented all his children to child_reaper, but before it notifies its parent about its death. The reason to release namespaces after reparenting is that when task exits it may send a signal to

[Devel] [PATCH 11/15] Signal semantics

2007-07-26 Thread Pavel Emelyanov
From: Sukadev Bhattiprolu [EMAIL PROTECTED] With support for multiple pid namespaces, each pid namespace has a separate child reaper and this process needs some special handling of signals. - The child reaper should appear like a normal process to other processes in its

[Devel] Re: [PATCH 7/15] Helpers to obtain pid numbers

2007-07-26 Thread Dave Hansen
On Thu, 2007-07-26 at 18:51 +0400, Pavel Emelyanov wrote: + * pid_nr(): global id, i.e. the id seen from the init namespace; + * pid_vnr() : virtual id, i.e. the id seen from the namespace this pid + * belongs to. this only makes sence when called in the + *

[Devel] [PATCH] Remove CTL_UNNUMBERED

2007-07-26 Thread Alexey Dobriyan
CTL_UNNUMBERED is unneeded, because it expands to .ctl_name = 0 The same effect can be achieved by skipping .ctl_name initialization, saving one line per sysctl. Update docs and headers telling people to not add CTL_ numbers and giving example. This is probably all we can do to stop

[Devel] [PATCH 0/2] refaults

2007-07-26 Thread Peter Zijlstra
Hi, This is a brush up of the refault patches, as presented by Rik at last year's OLS: http://people.redhat.com/riel/riel-OLS2006.pdf When talking to people at OLS this year there was a renewed interrest in the concept. ___ Containers mailing list

[Devel] Re: [PATCH 13/16] Switch to operating with pid_numbers instead of pids

2007-07-26 Thread Pavel Emelyanov
[EMAIL PROTECTED] wrote: Pavel Emelianov [EMAIL PROTECTED] wrote: | [EMAIL PROTECTED] wrote: | Pavel Emelianov [EMAIL PROTECTED] wrote: | | Make alloc_pid() initialize pid_numbers and hash them | | into the hashtable, not the struct pid itself. | | | | Signed-off-by: Pavel Emelianov [EMAIL

[Devel] Re: [PATCH] Fix leaks on /proc/{*/sched,sched_debug,timer_list,timer_stats}

2007-07-26 Thread Chris Wright
* Andrew Morton ([EMAIL PROTECTED]) wrote: Sorry, but I can't be bothered splitting it up. Greg, Chris: please just apply the bits which apply and drop the other bits if that's OK. Yup ___ Devel mailing list Devel@openvz.org