Commit 68ad8df42e12037c3894c9706ab428bf5cd6426b

Authored by Mel Gorman
Committed by Linus Torvalds
1 parent 2dbb51c49f

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>

Showing 3 changed files with 51 additions and 0 deletions Side-by-side Diff

... ... @@ -81,6 +81,7 @@
81 81 extern void mminit_verify_pageflags_layout(void);
82 82 extern void mminit_verify_page_links(struct page *page,
83 83 enum zone_type zone, unsigned long nid, unsigned long pfn);
  84 +extern void mminit_verify_zonelist(void);
84 85  
85 86 #else
86 87  
... ... @@ -95,6 +96,10 @@
95 96  
96 97 static inline void mminit_verify_page_links(struct page *page,
97 98 enum zone_type zone, unsigned long nid, unsigned long pfn)
  99 +{
  100 +}
  101 +
  102 +static inline void mminit_verify_zonelist(void)
98 103 {
99 104 }
100 105 #endif /* CONFIG_DEBUG_MEMORY_INIT */
... ... @@ -11,6 +11,51 @@
11 11  
12 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 59 void __init mminit_verify_pageflags_layout(void)
15 60 {
16 61 int shift, width;
... ... @@ -2352,6 +2352,7 @@
2352 2352  
2353 2353 if (system_state == SYSTEM_BOOTING) {
2354 2354 __build_all_zonelists(NULL);
  2355 + mminit_verify_zonelist();
2355 2356 cpuset_init_current_mems_allowed();
2356 2357 } else {
2357 2358 /* we have to stop all cpus to guarantee there is no user