linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: compaction: count compaction events only if compaction is enabled
@ 2012-12-20 10:21 Jiri Kosina
  2012-12-20 10:52 ` Mel Gorman
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Kosina @ 2012-12-20 10:21 UTC (permalink / raw)
  To: Mel Gorman, Andrew Morton, Rik van Riel, Minchan Kim,
	KAMEZAWA Hiroyuki
  Cc: linux-kernel, linux-mm

On configs which have CONFIG_CMA but no CONFIG_COMPACTION, 
isolate_migratepages_range() and isolate_freepages_block() must not 
account for COMPACTFREE_SCANNED and COMPACTISOLATED events (those 
constants are even undefined in such case, causing a build error).

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
---
 mm/compaction.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index 5ad7f4f..ca4cd82 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -303,9 +303,11 @@ static unsigned long isolate_freepages_block(struct compact_control *cc,
 	if (blockpfn == end_pfn)
 		update_pageblock_skip(cc, valid_page, total_isolated, false);
 
+#ifdef CONFIG_COMPACTION
 	count_vm_events(COMPACTFREE_SCANNED, nr_scanned);
 	if (total_isolated)
 		count_vm_events(COMPACTISOLATED, total_isolated);
+#endif
 
 	return total_isolated;
 }
@@ -613,9 +615,11 @@ next_pageblock:
 
 	trace_mm_compaction_isolate_migratepages(nr_scanned, nr_isolated);
 
+#ifdef CONFIG_COMPACTION
 	count_vm_events(COMPACTMIGRATE_SCANNED, nr_scanned);
 	if (nr_isolated)
 		count_vm_events(COMPACTISOLATED, nr_isolated);
+#endif
 
 	return low_pfn;
 }

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-12-20 10:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-20 10:21 [PATCH] mm: compaction: count compaction events only if compaction is enabled Jiri Kosina
2012-12-20 10:52 ` Mel Gorman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).