Re: [PATCH 1/3] [PATCH i386] during VM oom condition, kill all threads in process group

2 messages, 2 authors, 2007-06-13 · open the first message on its own page

Re: [PATCH 1/3] [PATCH i386] during VM oom condition, kill all threads in process group

From: Eric W. Biederman <hidden>
Date: 2007-06-08 22:50:47

Will Schmidt [off-list ref] writes:
On Fri, 2007-06-08 at 12:32 -0700, Andrew Morton wrote:
quoted
On Fri, 08 Jun 2007 14:19:18 -0500
Will Schmidt [off-list ref] wrote:
quoted
quoted
quoted
quoted
zap_other_threads() requires tasklist_lock.
quoted
In fact, it's probably the case that rcu_read_lock() is now sufficient
locking coverage for zap_other_threads() (cc's people).

It had better be, because do_group_exit() forgot to take tasklist_lock.  It
is perhaps relying upon spin_lock()'s hidden rcu_read_lock() properties
without so much as a code comment, which would be somewhat nasty of it.
quoted
You could perhaps just call do_group_exit() from within the fault
handler,
btw.
Yup, so looks like I can actually replace the existing do_exit() call
with do_group_exit().   I'll sit on this for a bit to give other folks a
chance to comment on which lock call is sufficient, read_lock() or
rcu_read_lock(), etc;  and do_group_exit()'s issue with taking
tasklist_lock. 
No.  The rcu_read_lock is not sufficient.
Yes.  sighand->siglock is enough, and we explicitly take it in
do_group_exit before calling zap_other_threads.

Unless I have completely miss-understood this thread.

Eric

Re: [PATCH 1/3] [PATCH i386] during VM oom condition, kill all threads in process group

From: Oleg Nesterov <hidden>
Date: 2007-06-13 15:51:32

On 06/08, Eric W. Biederman wrote:
Will Schmidt [off-list ref] writes:
quoted
On Fri, 2007-06-08 at 12:32 -0700, Andrew Morton wrote:
quoted
On Fri, 08 Jun 2007 14:19:18 -0500
Will Schmidt [off-list ref] wrote:
quoted
quoted
quoted
quoted
zap_other_threads() requires tasklist_lock.
quoted
In fact, it's probably the case that rcu_read_lock() is now sufficient
locking coverage for zap_other_threads() (cc's people).

It had better be, because do_group_exit() forgot to take tasklist_lock.  It
is perhaps relying upon spin_lock()'s hidden rcu_read_lock() properties
without so much as a code comment, which would be somewhat nasty of it.
quoted
You could perhaps just call do_group_exit() from within the fault
handler,
btw.
Yup, so looks like I can actually replace the existing do_exit() call
with do_group_exit().   I'll sit on this for a bit to give other folks a
chance to comment on which lock call is sufficient, read_lock() or
rcu_read_lock(), etc;  and do_group_exit()'s issue with taking
tasklist_lock. 
No.  The rcu_read_lock is not sufficient.
Yes.  sighand->siglock is enough, and we explicitly take it in
do_group_exit before calling zap_other_threads.
Yes, we don't need tasklist_lock (or rcu_read_lock).

de_thread() calls zap_other_threads() under tasklist_lock, but this
is because we can change child_reaper.

Oleg.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help