Commit 010fc29a authored by Minchan Kim's avatar Minchan Kim Committed by Linus Torvalds

compaction: fix build error in CMA && !COMPACTION

isolate_freepages_block() and isolate_migratepages_range() are used for
CMA as well as compaction so it breaks build for CONFIG_CMA &&
!CONFIG_COMPACTION.

This patch fixes it.

[akpm@linux-foundation.org: add "do { } while (0)", per Mel]
Signed-off-by: default avatarMinchan Kim <minchan@kernel.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 787314c3
...@@ -17,6 +17,21 @@ ...@@ -17,6 +17,21 @@
#include <linux/balloon_compaction.h> #include <linux/balloon_compaction.h>
#include "internal.h" #include "internal.h"
#ifdef CONFIG_COMPACTION
static inline void count_compact_event(enum vm_event_item item)
{
count_vm_event(item);
}
static inline void count_compact_events(enum vm_event_item item, long delta)
{
count_vm_events(item, delta);
}
#else
#define count_compact_event(item) do { } while (0)
#define count_compact_events(item, delta) do { } while (0)
#endif
#if defined CONFIG_COMPACTION || defined CONFIG_CMA #if defined CONFIG_COMPACTION || defined CONFIG_CMA
#define CREATE_TRACE_POINTS #define CREATE_TRACE_POINTS
...@@ -303,10 +318,9 @@ static unsigned long isolate_freepages_block(struct compact_control *cc, ...@@ -303,10 +318,9 @@ static unsigned long isolate_freepages_block(struct compact_control *cc,
if (blockpfn == end_pfn) if (blockpfn == end_pfn)
update_pageblock_skip(cc, valid_page, total_isolated, false); update_pageblock_skip(cc, valid_page, total_isolated, false);
count_vm_events(COMPACTFREE_SCANNED, nr_scanned); count_compact_events(COMPACTFREE_SCANNED, nr_scanned);
if (total_isolated) if (total_isolated)
count_vm_events(COMPACTISOLATED, total_isolated); count_compact_events(COMPACTISOLATED, total_isolated);
return total_isolated; return total_isolated;
} }
...@@ -613,9 +627,9 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc, ...@@ -613,9 +627,9 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
trace_mm_compaction_isolate_migratepages(nr_scanned, nr_isolated); trace_mm_compaction_isolate_migratepages(nr_scanned, nr_isolated);
count_vm_events(COMPACTMIGRATE_SCANNED, nr_scanned); count_compact_events(COMPACTMIGRATE_SCANNED, nr_scanned);
if (nr_isolated) if (nr_isolated)
count_vm_events(COMPACTISOLATED, nr_isolated); count_compact_events(COMPACTISOLATED, nr_isolated);
return low_pfn; return low_pfn;
} }
...@@ -1110,7 +1124,7 @@ unsigned long try_to_compact_pages(struct zonelist *zonelist, ...@@ -1110,7 +1124,7 @@ unsigned long try_to_compact_pages(struct zonelist *zonelist,
if (!order || !may_enter_fs || !may_perform_io) if (!order || !may_enter_fs || !may_perform_io)
return rc; return rc;
count_vm_event(COMPACTSTALL); count_compact_event(COMPACTSTALL);
#ifdef CONFIG_CMA #ifdef CONFIG_CMA
if (allocflags_to_migratetype(gfp_mask) == MIGRATE_MOVABLE) if (allocflags_to_migratetype(gfp_mask) == MIGRATE_MOVABLE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment