summaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorDavid Rientjes2011-11-01 01:07:11 +0100
committerLinus Torvalds2011-11-01 01:30:45 +0100
commit7b0d44fa49b1dcfdcf4897f12ddd12ddeab1a9d7 (patch)
treec840608f5266e4ba783f4c4405efe89b69ae5754 /kernel/fork.c
parentoom: thaw threads if oom killed thread is frozen before deferring (diff)
downloadkernel-qcow2-linux-7b0d44fa49b1dcfdcf4897f12ddd12ddeab1a9d7.tar.gz
kernel-qcow2-linux-7b0d44fa49b1dcfdcf4897f12ddd12ddeab1a9d7.tar.xz
kernel-qcow2-linux-7b0d44fa49b1dcfdcf4897f12ddd12ddeab1a9d7.zip
oom: avoid killing kthreads if they assume the oom killed thread's mm
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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/fork.c')
0 files changed, 0 insertions, 0 deletions