lkml.org 
[lkml]   [2011]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] Accelerate OOM killing
Date
When I test Andrey's problem, I saw the livelock and sysrq-t says
there are many tasks in cond_resched after try_to_free_pages.

If did_some_progress is false, cond_resched could delay oom killing so
It might be killing another task.

This patch accelerates oom killing without unnecessary giving CPU
to another task. It could help avoding unnecessary another task killing
and livelock situation a litte bit.

Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
---
mm/page_alloc.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index cdef1d4..b962575 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1887,11 +1887,10 @@ __alloc_pages_direct_reclaim(gfp_t gfp_mask, unsigned int order,
lockdep_clear_current_reclaim_state();
current->flags &= ~PF_MEMALLOC;

- cond_resched();
-
if (unlikely(!(*did_some_progress)))
return NULL;

+ cond_resched();
retry:
page = get_page_from_freelist(gfp_mask, nodemask, order,
zonelist, high_zoneidx,
--
1.7.1


\
 
 \ /
  Last update: 2011-03-24 10:55    [W:0.370 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site