The patch titled Subject: oom: thaw threads if oom killed thread is frozen before deferring has been added to the -mm tree. Its filename is oom-thaw-threads-if-oom-killed-thread-is-frozen-before-deferring.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/ ------------------------------------------------------ From: David Rientjes <rientjes@xxxxxxxxxx> Subject: oom: thaw threads if oom killed thread is frozen before deferring If a thread has been oom killed and is frozen, thaw it before returning to the page allocator. Otherwise, it can stay frozen indefinitely and no memory will be freed. Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx> Reported-by: Michal Hocko <mhocko@xxxxxxx> Cc: Oleg Nesterov <oleg@xxxxxxxxxx> Cc: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> Cc: "Rafael J. Wysocki" <rjw@xxxxxxx> Acked-by: Michal Hocko <mhocko@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/oom_kill.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff -puN mm/oom_kill.c~oom-thaw-threads-if-oom-killed-thread-is-frozen-before-deferring mm/oom_kill.c --- a/mm/oom_kill.c~oom-thaw-threads-if-oom-killed-thread-is-frozen-before-deferring +++ a/mm/oom_kill.c @@ -32,6 +32,7 @@ #include <linux/mempolicy.h> #include <linux/security.h> #include <linux/ptrace.h> +#include <linux/freezer.h> int sysctl_panic_on_oom; int sysctl_oom_kill_allocating_task; @@ -317,8 +318,11 @@ static struct task_struct *select_bad_pr * blocked waiting for another task which itself is waiting * for memory. Is there a better alternative? */ - if (test_tsk_thread_flag(p, TIF_MEMDIE)) + if (test_tsk_thread_flag(p, TIF_MEMDIE)) { + if (unlikely(frozen(p))) + thaw_process(p); return ERR_PTR(-1UL); + } if (!p->mm) continue; _ Subject: Subject: oom: thaw threads if oom killed thread is frozen before deferring Patches currently in -mm which might be from rientjes@xxxxxxxxxx are origin.patch proc-self-numa_maps-restore-huge-tag-for-hugetlb-vmas.patch linux-next.patch drm-avoid-switching-to-text-console-if-there-is-no-panic-timeout.patch oom-thaw-threads-if-oom-killed-thread-is-frozen-before-deferring.patch oom-avoid-killing-kthreads-if-they-assume-the-oom-killed-threads-mm.patch oom-remove-oom_disable_count.patch oom-fix-race-while-temporarily-setting-currents-oom_score_adj.patch mm-avoid-null-pointer-access-in-vm_struct-via-proc-vmallocinfo.patch mm-compaction-make-compact_zone_order-static.patch mm-do-not-drain-pagevecs-for-mlockallmcl_future.patch cpusets-avoid-looping-when-storing-to-mems_allowed-if-one-node-remains-set.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