aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorMel Gorman <mel@csn.ul.ie>2008-07-24 00:26:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 13:47:13 -0400
commit708614e6180f398cd307ea0048d48ba6fa274610 (patch)
tree8fedf22cf9a2f404e2aef10c5b3858b99880c4c2 /mm/page_alloc.c
parent6b74ab97bc12ce74acec900f1d89a4aee2e4d70d (diff)
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>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 0908352ba727..acab6ad326df 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2534,6 +2534,7 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
2534 } 2534 }
2535 page = pfn_to_page(pfn); 2535 page = pfn_to_page(pfn);
2536 set_page_links(page, zone, nid, pfn); 2536 set_page_links(page, zone, nid, pfn);
2537 mminit_verify_page_links(page, zone, nid, pfn);
2537 init_page_count(page); 2538 init_page_count(page);
2538 reset_page_mapcount(page); 2539 reset_page_mapcount(page);
2539 SetPageReserved(page); 2540 SetPageReserved(page);
@@ -2836,6 +2837,12 @@ __meminit int init_currently_empty_zone(struct zone *zone,
2836 2837
2837 zone->zone_start_pfn = zone_start_pfn; 2838 zone->zone_start_pfn = zone_start_pfn;
2838 2839
2840 mminit_dprintk(MMINIT_TRACE, "memmap_init",
2841 "Initialising map node %d zone %lu pfns %lu -> %lu\n",
2842 pgdat->node_id,
2843 (unsigned long)zone_idx(zone),
2844 zone_start_pfn, (zone_start_pfn + size));
2845
2839 zone_init_free_lists(zone); 2846 zone_init_free_lists(zone);
2840 2847
2841 return 0; 2848 return 0;
@@ -3961,6 +3968,7 @@ void __init free_area_init_nodes(unsigned long *max_zone_pfn)
3961 early_node_map[i].end_pfn); 3968 early_node_map[i].end_pfn);
3962 3969
3963 /* Initialise every node */ 3970 /* Initialise every node */
3971 mminit_verify_pageflags_layout();
3964 setup_nr_node_ids(); 3972 setup_nr_node_ids();
3965 for_each_online_node(nid) { 3973 for_each_online_node(nid) {
3966 pg_data_t *pgdat = NODE_DATA(nid); 3974 pg_data_t *pgdat = NODE_DATA(nid);