mm, page_owner: track and print last migrate reason-fix

From: Vlastimil Babka
Date: Thu Nov 26 2015 - 05:31:09 EST


Move migrate_reason_names from mm/migrate.c to mm/debug.c so that link doesn't
warn with CONFIG_MIGRATION disabled.

---
include/linux/migrate.h | 2 +-
mm/debug.c | 11 +++++++++++
mm/migrate.c | 10 ----------
3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index ab92a8cf4c93..8fdc033e527a 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -27,7 +27,7 @@ enum migrate_reason {
MR_TYPES
};

-/* In mm/migrate.c; also keep sync with include/trace/events/migrate.h */
+/* In mm/debug.c; also keep sync with include/trace/events/migrate.h */
extern char * migrate_reason_names[MR_TYPES];

#ifdef CONFIG_MIGRATION
diff --git a/mm/debug.c b/mm/debug.c
index d9718fc8377a..a4cd0c093ff6 100644
--- a/mm/debug.c
+++ b/mm/debug.c
@@ -9,6 +9,17 @@
#include <linux/mm.h>
#include <linux/trace_events.h>
#include <linux/memcontrol.h>
+#include <linux/migrate.h>
+
+char *migrate_reason_names[MR_TYPES] = {
+ "compaction",
+ "memory_failure",
+ "memory_hotplug",
+ "syscall_or_cpuset",
+ "mempolicy_mbind",
+ "numa_misplaced",
+ "cma",
+};

static const struct trace_print_flags pageflag_names[] = {
{1UL << PG_locked, "locked" },
diff --git a/mm/migrate.c b/mm/migrate.c
index 12e9ab9de446..1c11b73cd834 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -47,16 +47,6 @@

#include "internal.h"

-char *migrate_reason_names[MR_TYPES] = {
- "compaction",
- "memory_failure",
- "memory_hotplug",
- "syscall_or_cpuset",
- "mempolicy_mbind",
- "numa_misplaced",
- "cma",
-};
-
/*
* migrate_prep() needs to be called before we start compiling a list of pages
* to be migrated using isolate_lru_page(). If scheduling work on other CPUs is
--
2.6.3




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/