From 4e5e0b84f0126129ed6e415c71ce518906cd5bc6 Mon Sep 17 00:00:00 2001 From: David Rientjes Date: Wed, 29 Jul 2009 15:02:06 -0700 Subject: [PATCH] --- yaml --- r: 156033 b: refs/heads/master c: 6583bb64fc370842b32a87c67750c26f6d559af0 h: refs/heads/master i: 156031: 8c219f8a576352beebaeff0b9d83239a30135221 v: v3 --- [refs] | 2 +- trunk/mm/page_alloc.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index aeaff23c8e6c..9867144a19cd 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e084b2d95e48b31aa45f9c49ffc6cdae8bdb21d4 +refs/heads/master: 6583bb64fc370842b32a87c67750c26f6d559af0 diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c index ae28c22a7fdb..2dbb2fc68837 100644 --- a/trunk/mm/page_alloc.c +++ b/trunk/mm/page_alloc.c @@ -1794,6 +1794,10 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, if (p->flags & PF_MEMALLOC) goto nopage; + /* Avoid allocations with no watermarks from looping endlessly */ + if (test_thread_flag(TIF_MEMDIE) && !(gfp_mask & __GFP_NOFAIL)) + goto nopage; + /* Try direct reclaim and then allocating */ page = __alloc_pages_direct_reclaim(gfp_mask, order, zonelist, high_zoneidx,