aboutsummaryrefslogtreecommitdiffstats
path: root/mm/oom_kill.c
diff options
context:
space:
mode:
authorDavid Rientjes <rientjes@google.com>2011-10-31 20:07:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-10-31 20:30:45 -0400
commitf660daac474c6f7c2d710100e29b3276a6f4db0a (patch)
treead142e254a7b804cb158f2c64e9e6a77e8e4388c /mm/oom_kill.c
parentd08c429b06d21bd2add88aea2cd1996f1b9b3bda (diff)
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@google.com> Reported-by: Konstantin Khlebnikov <khlebnikov@openvz.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Acked-by: Michal Hocko <mhocko@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/oom_kill.c')
-rw-r--r--mm/oom_kill.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 626303b52f3c..d897262068e2 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -32,6 +32,7 @@
32#include <linux/mempolicy.h> 32#include <linux/mempolicy.h>
33#include <linux/security.h> 33#include <linux/security.h>
34#include <linux/ptrace.h> 34#include <linux/ptrace.h>
35#include <linux/freezer.h>
35 36
36int sysctl_panic_on_oom; 37int sysctl_panic_on_oom;
37int sysctl_oom_kill_allocating_task; 38int sysctl_oom_kill_allocating_task;
@@ -317,8 +318,11 @@ static struct task_struct *select_bad_process(unsigned int *ppoints,
317 * blocked waiting for another task which itself is waiting 318 * blocked waiting for another task which itself is waiting
318 * for memory. Is there a better alternative? 319 * for memory. Is there a better alternative?
319 */ 320 */
320 if (test_tsk_thread_flag(p, TIF_MEMDIE)) 321 if (test_tsk_thread_flag(p, TIF_MEMDIE)) {
322 if (unlikely(frozen(p)))
323 thaw_process(p);
321 return ERR_PTR(-1UL); 324 return ERR_PTR(-1UL);
325 }
322 if (!p->mm) 326 if (!p->mm)
323 continue; 327 continue;
324 328