[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1212201118080.17797@pobox.suse.cz>
Date: Thu, 20 Dec 2012 11:21:34 +0100 (CET)
From: Jiri Kosina <jkosina@...e.cz>
To: Mel Gorman <mgorman@...e.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Rik van Riel <riel@...hat.com>,
Minchan Kim <minchan@...nel.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: [PATCH] mm: compaction: count compaction events only if compaction
is enabled
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@...e.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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists