]> git.karo-electronics.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, 3 Aug 2011 00:52:51 +0000 (10:52 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 19 Aug 2011 02:31:20 +0000 (12:31 +1000)
commitae9ebeb875a6b7592967f90f7ff700f4f4e49878
tree7d53e8958cdcc96bf5c17c144a0b941861e930c8
parent3fd9eadbe0ccfac9b3f51aecc297de97a7697fa9
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