aboutsummaryrefslogtreecommitdiffstats
path: root/mm/compaction.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/compaction.c')
-rw-r--r--mm/compaction.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/mm/compaction.c b/mm/compaction.c
index 5ad7f4f4d6f7..6b807e466497 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -17,6 +17,21 @@
17#include <linux/balloon_compaction.h> 17#include <linux/balloon_compaction.h>
18#include "internal.h" 18#include "internal.h"
19 19
20#ifdef CONFIG_COMPACTION
21static inline void count_compact_event(enum vm_event_item item)
22{
23 count_vm_event(item);
24}
25
26static inline void count_compact_events(enum vm_event_item item, long delta)
27{
28 count_vm_events(item, delta);
29}
30#else
31#define count_compact_event(item) do { } while (0)
32#define count_compact_events(item, delta) do { } while (0)
33#endif
34
20#if defined CONFIG_COMPACTION || defined CONFIG_CMA 35#if defined CONFIG_COMPACTION || defined CONFIG_CMA
21 36
22#define CREATE_TRACE_POINTS 37#define CREATE_TRACE_POINTS
@@ -303,10 +318,9 @@ static unsigned long isolate_freepages_block(struct compact_control *cc,
303 if (blockpfn == end_pfn) 318 if (blockpfn == end_pfn)
304 update_pageblock_skip(cc, valid_page, total_isolated, false); 319 update_pageblock_skip(cc, valid_page, total_isolated, false);
305 320
306 count_vm_events(COMPACTFREE_SCANNED, nr_scanned); 321 count_compact_events(COMPACTFREE_SCANNED, nr_scanned);
307 if (total_isolated) 322 if (total_isolated)
308 count_vm_events(COMPACTISOLATED, total_isolated); 323 count_compact_events(COMPACTISOLATED, total_isolated);
309
310 return total_isolated; 324 return total_isolated;
311} 325}
312 326
@@ -613,9 +627,9 @@ next_pageblock:
613 627
614 trace_mm_compaction_isolate_migratepages(nr_scanned, nr_isolated); 628 trace_mm_compaction_isolate_migratepages(nr_scanned, nr_isolated);
615 629
616 count_vm_events(COMPACTMIGRATE_SCANNED, nr_scanned); 630 count_compact_events(COMPACTMIGRATE_SCANNED, nr_scanned);
617 if (nr_isolated) 631 if (nr_isolated)
618 count_vm_events(COMPACTISOLATED, nr_isolated); 632 count_compact_events(COMPACTISOLATED, nr_isolated);
619 633
620 return low_pfn; 634 return low_pfn;
621} 635}
@@ -1110,7 +1124,7 @@ unsigned long try_to_compact_pages(struct zonelist *zonelist,
1110 if (!order || !may_enter_fs || !may_perform_io) 1124 if (!order || !may_enter_fs || !may_perform_io)
1111 return rc; 1125 return rc;
1112 1126
1113 count_vm_event(COMPACTSTALL); 1127 count_compact_event(COMPACTSTALL);
1114 1128
1115#ifdef CONFIG_CMA 1129#ifdef CONFIG_CMA
1116 if (allocflags_to_migratetype(gfp_mask) == MIGRATE_MOVABLE) 1130 if (allocflags_to_migratetype(gfp_mask) == MIGRATE_MOVABLE)