mm: verify the page links and memory model
Print out information on how the page flags are being used if mminit_loglevel is MMINIT_VERIFY or higher and unconditionally performs sanity checks on the flags regardless of loglevel. When the page flags are updated with section, node and zone information, a check are made to ensure the values can be retrieved correctly. Finally we confirm that pfn_to_page and page_to_pfn are the correct inverse functions. [akpm@linux-foundation.org: fix printk warnings] 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>
This commit is contained in:
committed by
Linus Torvalds
parent
6b74ab97bc
commit
708614e618
@@ -2534,6 +2534,7 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
|
||||
}
|
||||
page = pfn_to_page(pfn);
|
||||
set_page_links(page, zone, nid, pfn);
|
||||
mminit_verify_page_links(page, zone, nid, pfn);
|
||||
init_page_count(page);
|
||||
reset_page_mapcount(page);
|
||||
SetPageReserved(page);
|
||||
@@ -2836,6 +2837,12 @@ __meminit int init_currently_empty_zone(struct zone *zone,
|
||||
|
||||
zone->zone_start_pfn = zone_start_pfn;
|
||||
|
||||
mminit_dprintk(MMINIT_TRACE, "memmap_init",
|
||||
"Initialising map node %d zone %lu pfns %lu -> %lu\n",
|
||||
pgdat->node_id,
|
||||
(unsigned long)zone_idx(zone),
|
||||
zone_start_pfn, (zone_start_pfn + size));
|
||||
|
||||
zone_init_free_lists(zone);
|
||||
|
||||
return 0;
|
||||
@@ -3961,6 +3968,7 @@ void __init free_area_init_nodes(unsigned long *max_zone_pfn)
|
||||
early_node_map[i].end_pfn);
|
||||
|
||||
/* Initialise every node */
|
||||
mminit_verify_pageflags_layout();
|
||||
setup_nr_node_ids();
|
||||
for_each_online_node(nid) {
|
||||
pg_data_t *pgdat = NODE_DATA(nid);
|
||||
|
Reference in New Issue
Block a user