linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [patch resend] oom: thaw threads if oom killed thread is frozen before deferring
@ 2011-10-08  2:56 David Rientjes
  2011-10-08  2:59 ` [patch v2] " David Rientjes
  2011-10-11 19:16 ` [patch resend] " Oleg Nesterov
  0 siblings, 2 replies; 17+ messages in thread
From: David Rientjes @ 2011-10-08  2:56 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Oleg Nesterov, KOSAKI Motohiro, KAMEZAWA Hiroyuki,
	Rafael J. Wysocki, Michal Hocko, linux-mm

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.

Reported-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: David Rientjes <rientjes@google.com>
---
 mm/oom_kill.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -318,8 +318,11 @@ static struct task_struct *select_bad_process(unsigned int *ppoints,
 		 * 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;
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2011-10-12 14:44 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-08  2:56 [patch resend] oom: thaw threads if oom killed thread is frozen before deferring David Rientjes
2011-10-08  2:59 ` [patch v2] " David Rientjes
2011-10-08  7:23   ` KOSAKI Motohiro
2011-10-11  6:33     ` Michal Hocko
2011-10-11 14:50       ` KOSAKI Motohiro
2011-10-11 15:14         ` Michal Hocko
2011-10-11 15:57           ` KOSAKI Motohiro
2011-10-11 19:07             ` Michal Hocko
2011-10-11 23:36       ` David Rientjes
2011-10-11 23:39         ` Tejun Heo
2011-10-11 23:46           ` David Rientjes
2011-10-12  6:50         ` Michal Hocko
2011-10-12  6:58           ` Michal Hocko
2011-10-11 19:16 ` [patch resend] " Oleg Nesterov
2011-10-11 23:30   ` David Rientjes
2011-10-11 23:41     ` Andrew Morton
2011-10-12 14:40     ` Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).