From: David Rientjes Date: Tue, 1 Nov 2011 00:07:11 +0000 (-0700) Subject: oom: avoid killing kthreads if they assume the oom killed thread's mm X-Git-Tag: v3.2-rc1~108^2~112 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b0d44fa49b1dcfdcf4897f12ddd12ddeab1a9d7;p=pandora-kernel.git 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 Reviewed-by: Michal Hocko Reviewed-by: KOSAKI Motohiro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed