projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
32dba98
)
thp: don't alloc harder for gfp nomemalloc even if nowait
author
Andrea Arcangeli
<
[email protected]
>
Thu, 13 Jan 2011 23:46:49 +0000
(15:46 -0800)
committer
Linus Torvalds
<
[email protected]
>
Fri, 14 Jan 2011 01:32:42 +0000
(17:32 -0800)
Not worth throwing away the precious reserved free memory pool for
allocations that can fail gracefully (either through mempool or because
they're transhuge allocations later falling back to 4k allocations).
Signed-off-by: Andrea Arcangeli <
[email protected]
>
Acked-by: Rik van Riel <
[email protected]
>
Reviewed-by: KOSAKI Motohiro <
[email protected]
>
Acked-by: Mel Gorman <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
mm/page_alloc.c
patch
|
blob
|
history
diff --git
a/mm/page_alloc.c
b/mm/page_alloc.c
index bbd0423f282047900fd76b4c88081de6603eaf16..e7664b9f706c39cd999784dc4423e8d5dcaf03d5 100644
(file)
--- a/
mm/page_alloc.c
+++ b/
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.