diff options
author | Mel Gorman <mel@csn.ul.ie> | 2008-07-23 21:26:52 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 10:47:13 -0700 |
commit | 2dbb51c49f4fecb8330e43247a0edfbc4b2b8974 (patch) | |
tree | 507f06335dd1e66144f176e8e863743895e43d79 /mm/bootmem.c | |
parent | 708614e6180f398cd307ea0048d48ba6fa274610 (diff) | |
download | lwn-2dbb51c49f4fecb8330e43247a0edfbc4b2b8974.tar.gz lwn-2dbb51c49f4fecb8330e43247a0edfbc4b2b8974.zip |
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/bootmem.c')
-rw-r--r-- | mm/bootmem.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/bootmem.c b/mm/bootmem.c index 8d9f60e06f62..9f4bbc5da73f 100644 --- a/mm/bootmem.c +++ b/mm/bootmem.c @@ -91,6 +91,7 @@ static unsigned long __init init_bootmem_core(pg_data_t *pgdat, bootmem_data_t *bdata = pgdat->bdata; unsigned long mapsize; + mminit_validate_memmodel_limits(&start, &end); bdata->node_bootmem_map = phys_to_virt(PFN_PHYS(mapstart)); bdata->node_boot_start = PFN_PHYS(start); bdata->node_low_pfn = end; |