aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorMel Gorman <mel@csn.ul.ie>2008-07-24 00:26:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 13:47:13 -0400
commit2dbb51c49f4fecb8330e43247a0edfbc4b2b8974 (patch)
tree507f06335dd1e66144f176e8e863743895e43d79 /mm/page_alloc.c
parent708614e6180f398cd307ea0048d48ba6fa274610 (diff)
mm: make defensive checks around PFN values registered for memory usage
There are a number of different views to how much memory is currently active. There is the arch-independent zone-sizing view, the bootmem allocator and memory models view. Architectures register this information at different times and is not necessarily in sync particularly with respect to some SPARSEMEM limitations. This patch introduces mminit_validate_memmodel_limits() which is able to validate and correct PFN ranges with respect to the memory model. It is only SPARSEMEM that currently validates itself. 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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index acab6ad326df..0adb66e711e6 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3536,6 +3536,8 @@ void __init add_active_range(unsigned int nid, unsigned long start_pfn,
3536 nid, start_pfn, end_pfn, 3536 nid, start_pfn, end_pfn,
3537 nr_nodemap_entries, MAX_ACTIVE_REGIONS); 3537 nr_nodemap_entries, MAX_ACTIVE_REGIONS);
3538 3538
3539 mminit_validate_memmodel_limits(&start_pfn, &end_pfn);
3540
3539 /* Merge with existing active regions if possible */ 3541 /* Merge with existing active regions if possible */
3540 for (i = 0; i < nr_nodemap_entries; i++) { 3542 for (i = 0; i < nr_nodemap_entries; i++) {
3541 if (early_node_map[i].nid != nid) 3543 if (early_node_map[i].nid != nid)