]> 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, 24 Aug 2011 23:46:49 +0000 (09:46 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 31 Aug 2011 04:27:28 +0000 (14:27 +1000)
commit04e6a96db6c78ffbb05a56628350b39742bba96c
treec38e57de1d6f03f937dd3ae2697cb64e00702164
parent26fdb1fba764a6068a0bd98db38c8a0b629f331f
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