]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
After selecting a task to kill, the oom killer iterates all processes and
authorDavid Rientjes <rientjes@google.com>
Wed, 24 Aug 2011 23:46:49 +0000 (09:46 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 19 Sep 2011 08:03:45 +0000 (18:03 +1000)
commitdb415030674c7039124d2d132c6c021f9f50cd77
treeaa115b9cfeefc756100ea13d7d8a3e6aed1f6d43
parentd999573205c1570281af9613efc6d24c309fe77a
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.

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>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/oom_kill.c