From 7d964faaa7c5b52e24b55582a6e94b8ed95131d6 Mon Sep 17 00:00:00 2001 From: Andrea Arcangeli Date: Thu, 13 Jan 2011 15:46:49 -0800 Subject: [PATCH] --- yaml --- r: 230770 b: refs/heads/master c: 5c3240d92e29ae7bfb9cb58a9b37e80ab40894ff h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/mm/page_alloc.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 9567226698a7..118c45a348e7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 32dba98e085f8b2b4345887df9abf5e0e93bfc12 +refs/heads/master: 5c3240d92e29ae7bfb9cb58a9b37e80ab40894ff diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c index bbd0423f2820..e7664b9f706c 100644 --- a/trunk/mm/page_alloc.c +++ b/trunk/mm/page_alloc.c @@ -1971,7 +1971,12 @@ gfp_to_alloc_flags(gfp_t gfp_mask) alloc_flags |= (__force int) (gfp_mask & __GFP_HIGH); if (!wait) { - alloc_flags |= ALLOC_HARDER; + /* + * Not worth trying to allocate harder for + * __GFP_NOMEMALLOC even if it can't schedule. + */ + if (!(gfp_mask & __GFP_NOMEMALLOC)) + alloc_flags |= ALLOC_HARDER; /* * Ignore cpuset if GFP_ATOMIC (!wait) rather than fail alloc. * See also cpuset_zone_allowed() comment in kernel/cpuset.c.