diff options
author | Mel Gorman <mel@csn.ul.ie> | 2008-07-24 00:26:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 13:47:14 -0400 |
commit | 68ad8df42e12037c3894c9706ab428bf5cd6426b (patch) | |
tree | 42999fc8e3cbf400b6133f832f310690f8f28b76 /mm | |
parent | 2dbb51c49f4fecb8330e43247a0edfbc4b2b8974 (diff) |
mm: print out the zonelists on request for manual verification
This patch prints out the zonelists during boot for manual verification by the
user if the mminit_loglevel is MMINIT_VERIFY or higher.
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Andy Whitcroft <apw@shadowen.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/internal.h | 5 | ||||
-rw-r--r-- | mm/mm_init.c | 45 | ||||
-rw-r--r-- | mm/page_alloc.c | 1 |
3 files changed, 51 insertions, 0 deletions
diff --git a/mm/internal.h b/mm/internal.h index 5d17f3efac41..50807e12490e 100644 --- a/mm/internal.h +++ b/mm/internal.h | |||
@@ -81,6 +81,7 @@ do { \ | |||
81 | extern void mminit_verify_pageflags_layout(void); | 81 | extern void mminit_verify_pageflags_layout(void); |
82 | extern void mminit_verify_page_links(struct page *page, | 82 | extern void mminit_verify_page_links(struct page *page, |
83 | enum zone_type zone, unsigned long nid, unsigned long pfn); | 83 | enum zone_type zone, unsigned long nid, unsigned long pfn); |
84 | extern void mminit_verify_zonelist(void); | ||
84 | 85 | ||
85 | #else | 86 | #else |
86 | 87 | ||
@@ -97,6 +98,10 @@ static inline void mminit_verify_page_links(struct page *page, | |||
97 | enum zone_type zone, unsigned long nid, unsigned long pfn) | 98 | enum zone_type zone, unsigned long nid, unsigned long pfn) |
98 | { | 99 | { |
99 | } | 100 | } |
101 | |||
102 | static inline void mminit_verify_zonelist(void) | ||
103 | { | ||
104 | } | ||
100 | #endif /* CONFIG_DEBUG_MEMORY_INIT */ | 105 | #endif /* CONFIG_DEBUG_MEMORY_INIT */ |
101 | 106 | ||
102 | /* mminit_validate_memmodel_limits is independent of CONFIG_DEBUG_MEMORY_INIT */ | 107 | /* mminit_validate_memmodel_limits is independent of CONFIG_DEBUG_MEMORY_INIT */ |
diff --git a/mm/mm_init.c b/mm/mm_init.c index e16990d629e6..ce445ca097e7 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c | |||
@@ -11,6 +11,51 @@ | |||
11 | 11 | ||
12 | int __meminitdata mminit_loglevel; | 12 | int __meminitdata mminit_loglevel; |
13 | 13 | ||
14 | /* The zonelists are simply reported, validation is manual. */ | ||
15 | void mminit_verify_zonelist(void) | ||
16 | { | ||
17 | int nid; | ||
18 | |||
19 | if (mminit_loglevel < MMINIT_VERIFY) | ||
20 | return; | ||
21 | |||
22 | for_each_online_node(nid) { | ||
23 | pg_data_t *pgdat = NODE_DATA(nid); | ||
24 | struct zone *zone; | ||
25 | struct zoneref *z; | ||
26 | struct zonelist *zonelist; | ||
27 | int i, listid, zoneid; | ||
28 | |||
29 | BUG_ON(MAX_ZONELISTS > 2); | ||
30 | for (i = 0; i < MAX_ZONELISTS * MAX_NR_ZONES; i++) { | ||
31 | |||
32 | /* Identify the zone and nodelist */ | ||
33 | zoneid = i % MAX_NR_ZONES; | ||
34 | listid = i / MAX_NR_ZONES; | ||
35 | zonelist = &pgdat->node_zonelists[listid]; | ||
36 | zone = &pgdat->node_zones[zoneid]; | ||
37 | if (!populated_zone(zone)) | ||
38 | continue; | ||
39 | |||
40 | /* Print information about the zonelist */ | ||
41 | printk(KERN_DEBUG "mminit::zonelist %s %d:%s = ", | ||
42 | listid > 0 ? "thisnode" : "general", nid, | ||
43 | zone->name); | ||
44 | |||
45 | /* Iterate the zonelist */ | ||
46 | for_each_zone_zonelist(zone, z, zonelist, zoneid) { | ||
47 | #ifdef CONFIG_NUMA | ||
48 | printk(KERN_CONT "%d:%s ", | ||
49 | zone->node, zone->name); | ||
50 | #else | ||
51 | printk(KERN_CONT "0:%s ", zone->name); | ||
52 | #endif /* CONFIG_NUMA */ | ||
53 | } | ||
54 | printk(KERN_CONT "\n"); | ||
55 | } | ||
56 | } | ||
57 | } | ||
58 | |||
14 | void __init mminit_verify_pageflags_layout(void) | 59 | void __init mminit_verify_pageflags_layout(void) |
15 | { | 60 | { |
16 | int shift, width; | 61 | int shift, width; |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 0adb66e711e6..9ece07ce65b0 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -2352,6 +2352,7 @@ void build_all_zonelists(void) | |||
2352 | 2352 | ||
2353 | if (system_state == SYSTEM_BOOTING) { | 2353 | if (system_state == SYSTEM_BOOTING) { |
2354 | __build_all_zonelists(NULL); | 2354 | __build_all_zonelists(NULL); |
2355 | mminit_verify_zonelist(); | ||
2355 | cpuset_init_current_mems_allowed(); | 2356 | cpuset_init_current_mems_allowed(); |
2356 | } else { | 2357 | } else { |
2357 | /* we have to stop all cpus to guarantee there is no user | 2358 | /* we have to stop all cpus to guarantee there is no user |