8 #include <linux/kernel.h>
11 #include <linux/export.h>
14 #ifdef CONFIG_DEBUG_MEMORY_INIT
17 #ifndef SECTIONS_SHIFT
18 #define SECTIONS_SHIFT 0
22 void mminit_verify_zonelist(
void)
34 int i, listid, zoneid;
40 zoneid = i % MAX_NR_ZONES;
41 listid = i / MAX_NR_ZONES;
44 if (!populated_zone(zone))
49 listid > 0 ?
"thisnode" :
"general", nid,
56 zone->node, zone->
name);
66 void __init mminit_verify_pageflags_layout(
void)
69 unsigned long or_mask, add_mask;
71 shift = 8 *
sizeof(
unsigned long);
72 width = shift - SECTIONS_WIDTH - NODES_WIDTH - ZONES_WIDTH;
74 "Section %d Node %d Zone %d Flags %d\n",
80 "Section %d Node %d Zone %d\n",
85 "Section %lu Node %lu Zone %lu\n",
86 (
unsigned long)SECTIONS_PGSHIFT,
87 (
unsigned long)NODES_PGSHIFT,
88 (
unsigned long)ZONES_PGSHIFT);
90 "Zone ID: %lu -> %lu\n",
91 (
unsigned long)ZONEID_PGOFF,
92 (
unsigned long)(ZONEID_PGOFF + ZONEID_SHIFT));
94 "location: %d -> %d unused %d -> %d flags %d -> %d\n",
95 shift, width, width, NR_PAGEFLAGS, NR_PAGEFLAGS, 0);
96 #ifdef NODE_NOT_IN_PAGE_FLAGS
97 mminit_dprintk(
MMINIT_TRACE,
"pageflags_layout_nodeflags",
98 "Node not in page flags");
101 if (SECTIONS_WIDTH) {
102 shift -= SECTIONS_WIDTH;
103 BUG_ON(shift != SECTIONS_PGSHIFT);
106 shift -= NODES_WIDTH;
107 BUG_ON(shift != NODES_PGSHIFT);
110 shift -= ZONES_WIDTH;
111 BUG_ON(shift != ZONES_PGSHIFT);
115 or_mask = (ZONES_MASK << ZONES_PGSHIFT) |
116 (NODES_MASK << NODES_PGSHIFT) |
117 (SECTIONS_MASK << SECTIONS_PGSHIFT);
118 add_mask = (ZONES_MASK << ZONES_PGSHIFT) +
119 (NODES_MASK << NODES_PGSHIFT) +
120 (SECTIONS_MASK << SECTIONS_PGSHIFT);
121 BUG_ON(or_mask != add_mask);
125 unsigned long nid,
unsigned long pfn)
127 BUG_ON(page_to_nid(page) != nid);
128 BUG_ON(page_zonenum(page) != zone);
132 static __init int set_mminit_loglevel(
char *
str)
137 early_param(
"mminit_loglevel", set_mminit_loglevel);
143 static int __init mm_sysfs_init(
void)