The patch titled oom: check PF_KTHREAD instead of !mm to skip kthreads has been added to the -mm tree. Its filename is oom-check-pf_kthread-instead-of-mm-to-skip-kthreads.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: oom: check PF_KTHREAD instead of !mm to skip kthreads From: Oleg Nesterov <oleg@xxxxxxxxxx> select_bad_process() thinks a kernel thread can't have ->mm != NULL, this is not true due to use_mm(). Change the code to check PF_KTHREAD. Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx> Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx> Cc: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> Cc: Balbir Singh <balbir@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/oom_kill.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff -puN mm/oom_kill.c~oom-check-pf_kthread-instead-of-mm-to-skip-kthreads mm/oom_kill.c --- a/mm/oom_kill.c~oom-check-pf_kthread-instead-of-mm-to-skip-kthreads +++ a/mm/oom_kill.c @@ -256,14 +256,11 @@ static struct task_struct *select_bad_pr for_each_process(p) { unsigned long points; - /* - * skip kernel threads and tasks which have already released - * their mm. - */ + /* skip tasks that have already released their mm */ if (!p->mm) continue; - /* skip the init task */ - if (is_global_init(p)) + /* skip the init task and kthreads */ + if (is_global_init(p) || (p->flags & PF_KTHREAD)) continue; if (mem && !task_in_mem_cgroup(p, mem)) continue; _ Patches currently in -mm which might be from oleg@xxxxxxxxxx are oom-check-pf_kthread-instead-of-mm-to-skip-kthreads.patch oom-pf_exiting-check-should-take-mm-into-account.patch oom-introduce-find_lock_task_mm-to-fix-mm-false-positives.patch oom-dump_tasks-use-find_lock_task_mm-too.patch sys_personality-remove-the-bogus-checks-in-sys_personality-__set_personality-path.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html