linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Michal Hocko <mhocko@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	linux-mm@kvack.org
Subject: Re: [patch] oom: avoid killing kthreads if they assume the oom killed thread's mm
Date: Tue, 26 Jul 2011 15:05:23 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.00.1107261502410.19338@chino.kir.corp.google.com> (raw)
In-Reply-To: <20110726152724.GE17958@tiehlicka.suse.cz>

On Tue, 26 Jul 2011, Michal Hocko wrote:

> > After selecting a task to kill, the oom killer iterates all processes and
> > kills all other threads that share the same mm_struct in different thread
> > groups.  It would not otherwise be helpful to kill a thread if its memory
> > would not be subsequently freed.
> > 
> > A kernel thread, however, may assume a user thread's mm by using
> > use_mm().  This is only temporary and should not result in sending a
> > SIGKILL to that kthread.
> 
> Good catch. Have you ever seen this happening?
> 

No, this is just another patch to make the kernel more use_mm()-friendly.  
Before that capability was introduced, it was possible to assume that a 
kthread would always have a NULL mm pointer, so it wasn't previously 
required for this code.

> > This patch ensures that only user threads and not kthreads are sent a
> > SIGKILL if they share the same mm_struct as the oom killed task.
> > 
> > Signed-off-by: David Rientjes <rientjes@google.com>
> 
> Reviewed-by: Michal Hocko <mhocko@suse.cz>

Thanks!

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-07-26 22:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-26  0:12 David Rientjes
2011-07-26 15:27 ` Michal Hocko
2011-07-26 22:05   ` David Rientjes [this message]
2011-07-27  7:59     ` Michal Hocko
2011-07-27  0:35 ` KOSAKI Motohiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.00.1107261502410.19338@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox