[Devel] Re: [PATCH 15/15] Hooks over the code to show correct values to user

2007-07-29 Thread Pavel Emelyanov
Oleg Nesterov wrote: On 07/26, Pavel Emelyanov wrote: int kill_proc(pid_t pid, int sig, int priv) { - return kill_proc_info(sig, __si_special(priv), pid); + int ret; + + rcu_read_lock(); + ret = kill_pid_info(sig, __si_special(priv), find_pid(pid)); + rcu_read_unloc

[Devel] Re: [PATCH 10/15] Make each namespace has its own proc tree

2007-07-29 Thread Pavel Emelyanov
Oleg Nesterov wrote: On 07/29, Oleg Nesterov wrote: Look, proc_flush_task() doesn't need pid, it can use active pid_ns Oops. Yes, proc_flush_task() doesn't use ->numbers[].nr, but it should? proc_flush_task_mnt() uses task->pid to flush /proc/$pid, this looks wrong, we should use ->number[ns-

[Devel] Re: [PATCH 10/15] Make each namespace has its own proc tree

2007-07-29 Thread Pavel Emelyanov
Oleg Nesterov wrote: On 07/26, Pavel Emelyanov wrote: static int proc_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data, struct vfsmount *mnt) { [...snip...] + if (!sb->s_root) { + sb->s_flags = flags; + err = proc_fil

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

2007-07-29 Thread Pavel Emelyanov
Oleg Nesterov wrote: On 07/26, Pavel Emelyanov wrote: This is a fix for Sukadev's patch that moved the alloc_pid() call from do_fork() into copy_process(). ... and this patch changes almost every line from Sukadev's patch. It does. My bad :( I have reviewed Suka's patch badly and was sure it

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

2007-07-29 Thread Pavel Emelyanov
Oleg Nesterov wrote: On 07/26, Pavel Emelyanov wrote: +#define find_pid(pid) find_pid_ns(pid, &init_pid_ns) Again, I think find_pid() should use current's active ns, not init_pid_ns. Just grep for find_pid/find_task_by_pid. --- linux-2.6.23-rc1-mm1.orig/kernel/pid.c 2007-07-26 16:34:45

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

2007-07-29 Thread Pavel Emelyanov
Oleg Nesterov wrote: On 07/26, Pavel Emelyanov wrote: --- linux-2.6.23-rc1-mm1.orig/include/linux/pid.h 2007-07-26 16:34:45.0 +0400 +++ linux-2.6.23-rc1-mm1-7/include/linux/pid.h 2007-07-26 16:36:37.0 +0400 @@ -83,12 +92,34 @@ extern void FASTCALL(detach_pid(struct t e

[Devel] Re: [PATCH 3/15] kern_siginfo helper

2007-07-29 Thread Pavel Emelyanov
Oleg Nesterov wrote: On 07/26, Pavel Emelyanov wrote: TODO: This is more an exploratory patch and modifies only interfaces necessary to implement correct signal semantics in pid namespaces. If the approach is feasible, we could consistently use 'kern_siginfo' i

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

2007-07-29 Thread Pavel Emelyanov
Oleg Nesterov wrote: On 07/26, Pavel Emelyanov wrote: -struct pid *alloc_pid(void) +struct pid *alloc_pid(struct pid_namespace *ns) Why? We have the only caller, copy_process(), ns == task_active_pid_ns() always. task_active_pid_ns() by newly created task, not the current! That's why we need

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

2007-07-29 Thread Pavel Emelyanov
Oleg Nesterov wrote: On 07/26, Pavel Emelyanov wrote: --- linux-2.6.23-rc1-mm1.orig/include/linux/pid.h 2007-07-26 16:34:45.0 +0400 +++ linux-2.6.23-rc1-mm1-7/include/linux/pid.h 2007-07-26 16:36:37.0 +0400 @@ -40,15 +40,21 @@ enum pid_type * processes. */ -struct

[Devel] Re: [PATCH 01/10] Task Containers(V11): Basic task container framework

2007-07-29 Thread YAMAMOTO Takashi
> +extern void container_init_smp(void); > +static inline void container_init_smp(void) {} stale prototypes? YAMAMOTO Takashi ___ Containers mailing list [EMAIL PROTECTED] https://lists.linux-foundation.org/mailman/listinfo/containers

[Devel] [Fwd: [2.6.22] negative time jump]

2007-07-29 Thread Vasily Averin
--- Begin Message --- I've investigated why my testnode freezes. When I found that node is freezed again I've started to press Sysrq keys and noticed the following negative time jump. Could anybody please help me to understand the reasons of this issue? --- VvS comment: some pre-history: node bo

[Devel] Re: [PATCH 01/10] Task Containers(V11): Basic task container framework

2007-07-29 Thread Paul Menage
On 7/26/07, YAMAMOTO Takashi <[EMAIL PROTECTED]> wrote: > > +Other fields in the container_subsys object include: > > > +- hierarchy: an index indicating which hierarchy, if any, this > > + subsystem is currently attached to. If this is -1, then the > > + subsystem is not attached to any hierarch

[Devel] Re: [PATCH 10/15] Make each namespace has its own proc tree

2007-07-29 Thread Oleg Nesterov
On 07/29, Oleg Nesterov wrote: > > Look, proc_flush_task() doesn't need pid, it can use active pid_ns Oops. Yes, proc_flush_task() doesn't use ->numbers[].nr, but it should? proc_flush_task_mnt() uses task->pid to flush /proc/$pid, this looks wrong, we should use ->number[ns->level].nr, no? Oleg

[Devel] Re: [PATCH 10/15] Make each namespace has its own proc tree

2007-07-29 Thread Oleg Nesterov
On 07/26, Pavel Emelyanov wrote: > > static int proc_get_sb(struct file_system_type *fs_type, > int flags, const char *dev_name, void *data, struct vfsmount *mnt) > { > [...snip...] > > + if (!sb->s_root) { > + sb->s_flags = flags; > + err = proc_fill_super(sb); >

[Devel] Re: [PATCH 15/15] Hooks over the code to show correct values to user

2007-07-29 Thread Oleg Nesterov
On 07/26, Pavel Emelyanov wrote: > > int > kill_proc(pid_t pid, int sig, int priv) > { > - return kill_proc_info(sig, __si_special(priv), pid); > + int ret; > + > + rcu_read_lock(); > + ret = kill_pid_info(sig, __si_special(priv), find_pid(pid)); > + rcu_read_unlock(); > + r

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

2007-07-29 Thread Oleg Nesterov
On 07/26, Pavel Emelyanov wrote: > > +#define find_pid(pid)find_pid_ns(pid, &init_pid_ns) Again, I think find_pid() should use current's active ns, not init_pid_ns. Just grep for find_pid/find_task_by_pid. > --- linux-2.6.23-rc1-mm1.orig/kernel/pid.c2007-07-26 16:34:45.0 > +0

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

2007-07-29 Thread Oleg Nesterov
On 07/26, Pavel Emelyanov wrote: > > --- linux-2.6.23-rc1-mm1.orig/include/linux/pid.h 2007-07-26 > 16:34:45.0 +0400 > +++ linux-2.6.23-rc1-mm1-7/include/linux/pid.h2007-07-26 > 16:36:37.0 +0400 > @@ -83,12 +92,34 @@ extern void FASTCALL(detach_pid(struct t > > extern

[Devel] Re: [PATCH 3/15] kern_siginfo helper

2007-07-29 Thread Oleg Nesterov
On 07/26, Pavel Emelyanov wrote: > > TODO: This is more an exploratory patch and modifies only interfaces > necessary to implement correct signal semantics in pid namespaces. > > If the approach is feasible, we could consistently use 'kern_siginfo' > in other signal

[Devel] Re: [PATCH 11/15] Signal semantics

2007-07-29 Thread Oleg Nesterov
On 07/27, [EMAIL PROTECTED] wrote: > > Pavel Emelianov [EMAIL PROTECTED] wrote: > | Oleg Nesterov wrote: > | >> > | >>@@ -1852,7 +1950,7 @@ relock: > | >> * within that pid space. It can of course get signals from > | >> * its parent pid space. > | >> */ > | >>-

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

2007-07-29 Thread Oleg Nesterov
On 07/26, Pavel Emelyanov wrote: > > @@ -895,6 +915,7 @@ fastcall NORET_TYPE void do_exit(long co > { > struct task_struct *tsk = current; > int group_dead; > + struct pid_namespace *pid_ns = tsk->nsproxy->pid_ns; > > profile_task_exit(tsk); > > @@ -905,9 +926,10 @@ fastcall

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

2007-07-29 Thread Oleg Nesterov
On 07/26, Pavel Emelyanov wrote: > > -struct pid *alloc_pid(void) > +struct pid *alloc_pid(struct pid_namespace *ns) Why? We have the only caller, copy_process(), ns == task_active_pid_ns() always. > { > struct pid *pid; > enum pid_type type; > - int nr = -1; > - struct pid_n

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

2007-07-29 Thread Oleg Nesterov
On 07/26, Pavel Emelyanov wrote: > > --- linux-2.6.23-rc1-mm1.orig/include/linux/pid.h 2007-07-26 > 16:34:45.0 +0400 > +++ linux-2.6.23-rc1-mm1-7/include/linux/pid.h2007-07-26 > 16:36:37.0 +0400 > @@ -40,15 +40,21 @@ enum pid_type > * processes. > */ > > -struct