* [PATCH? 3/3] move daemonized kernel threads into the swapper's session
@ 2007-11-26 14:25 Oleg Nesterov
2007-11-26 18:20 ` Oleg Nesterov
2007-11-26 18:57 ` Eric W. Biederman
0 siblings, 2 replies; 4+ messages in thread
From: Oleg Nesterov @ 2007-11-26 14:25 UTC (permalink / raw)
To: Andrew Morton; +Cc: Eric W. Biederman, Pavel Emelyanov, linux-kernel
Any reason why daemonized kthread still uses 1,1 special pids? This patch
sets 0,0 pids, this matches kthread_create'ed threads.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
--- PT/kernel/exit.c~3_daemonize_swapper 2007-11-26 16:47:35.000000000 +0300
+++ PT/kernel/exit.c 2007-11-26 17:10:41.000000000 +0300
@@ -390,7 +390,7 @@ void daemonize(const char *name, ...)
get_nsproxy(&init_nsproxy);
switch_task_namespaces(current, &init_nsproxy);
}
- set_special_pids(find_pid(1));
+ set_special_pids(&init_struct_pid);
proc_clear_tty(current);
/* Block and flush all signals */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH? 3/3] move daemonized kernel threads into the swapper's session
2007-11-26 14:25 [PATCH? 3/3] move daemonized kernel threads into the swapper's session Oleg Nesterov
@ 2007-11-26 18:20 ` Oleg Nesterov
2007-11-26 18:57 ` Eric W. Biederman
1 sibling, 0 replies; 4+ messages in thread
From: Oleg Nesterov @ 2007-11-26 18:20 UTC (permalink / raw)
To: Andrew Morton; +Cc: Eric W. Biederman, Pavel Emelyanov, linux-kernel
On 11/26, Oleg Nesterov wrote:
>
> Any reason why daemonized kthread still uses 1,1 special pids?
Actually, I guess the reason is that this was not possible before.
Now that set_special_pids uses "struct pid" we can do this.
Perhaps it is better to move the callsite to reparent_to_kthreadd()
and kill set_sepcial_pids().
Oleg.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH? 3/3] move daemonized kernel threads into the swapper's session
2007-11-26 14:25 [PATCH? 3/3] move daemonized kernel threads into the swapper's session Oleg Nesterov
2007-11-26 18:20 ` Oleg Nesterov
@ 2007-11-26 18:57 ` Eric W. Biederman
2007-11-26 19:23 ` Eric W. Biederman
1 sibling, 1 reply; 4+ messages in thread
From: Eric W. Biederman @ 2007-11-26 18:57 UTC (permalink / raw)
To: Oleg Nesterov; +Cc: Andrew Morton, Pavel Emelyanov, linux-kernel
Oleg Nesterov <oleg@tv-sign.ru> writes:
> Any reason why daemonized kthread still uses 1,1 special pids? This patch
> sets 0,0 pids, this matches kthread_create'ed threads.
You got it in your reply...
> Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Hmm. I wonder if we could ensure kernel_thread always
returns a global pid_t, and then reallocate the struct
pid for the task we have just daemonized so that it only
has a single pid in the init_pid_ns.
That would remove our capturing of child pid namespaces.
Eric
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH? 3/3] move daemonized kernel threads into the swapper's session
2007-11-26 18:57 ` Eric W. Biederman
@ 2007-11-26 19:23 ` Eric W. Biederman
0 siblings, 0 replies; 4+ messages in thread
From: Eric W. Biederman @ 2007-11-26 19:23 UTC (permalink / raw)
To: Oleg Nesterov; +Cc: Andrew Morton, Pavel Emelyanov, linux-kernel
ebiederm@xmission.com (Eric W. Biederman) writes:
> Hmm. I wonder if we could ensure kernel_thread always
> returns a global pid_t, and then reallocate the struct
> pid for the task we have just daemonized so that it only
> has a single pid in the init_pid_ns.
Well we can't reallocate the struct pid, if anyone was using
it we would have problems, but we can certainly remove all
pid_t values except for those in the init_pid_ns.
We definitely have some serious issues with kernel_thread
and signal sending though.
Eric
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-11-26 19:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-26 14:25 [PATCH? 3/3] move daemonized kernel threads into the swapper's session Oleg Nesterov
2007-11-26 18:20 ` Oleg Nesterov
2007-11-26 18:57 ` Eric W. Biederman
2007-11-26 19:23 ` Eric W. Biederman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®