summaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorVlastimil Babka <vbabka@suse.cz>2014-01-21 15:51:07 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-21 16:19:48 -0800
commitde6c60a6c115acaa721cfd499e028a413d1fcbf3 (patch)
tree81277ea0bf611f37544dbb0a22e4eff3fc2a9aa8 /mm/page_alloc.c
parent0eb927c0ab789d3d7d69f68acb850f69d4e7c36f (diff)
downloadop-kernel-dev-de6c60a6c115acaa721cfd499e028a413d1fcbf3.zip
op-kernel-dev-de6c60a6c115acaa721cfd499e028a413d1fcbf3.tar.gz
mm: compaction: encapsulate defer reset logic
Currently there are several functions to manipulate the deferred compaction state variables. The remaining case where the variables are touched directly is when a successful allocation occurs in direct compaction, or is expected to be successful in the future by kswapd. Here, the lowest order that is expected to fail is updated, and in the case of successful allocation, the deferred status and counter is reset completely. Create a new function compaction_defer_reset() to encapsulate this functionality and make it easier to understand the code. No functional change. Signed-off-by: Vlastimil Babka <vbabka@suse.cz> Acked-by: Mel Gorman <mgorman@suse.de> Reviewed-by: Rik van Riel <riel@redhat.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index b230e83..84da0e3 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2235,10 +2235,7 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order,
preferred_zone, migratetype);
if (page) {
preferred_zone->compact_blockskip_flush = false;
- preferred_zone->compact_considered = 0;
- preferred_zone->compact_defer_shift = 0;
- if (order >= preferred_zone->compact_order_failed)
- preferred_zone->compact_order_failed = order + 1;
+ compaction_defer_reset(preferred_zone, order, true);
count_vm_event(COMPACTSUCCESS);
return page;
}
OpenPOWER on IntegriCloud