mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-08 07:21:27 +00:00
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>
This commit is contained in:
parent
708614e618
commit
2dbb51c49f
4 changed files with 44 additions and 8 deletions
|
@ -3536,6 +3536,8 @@ void __init add_active_range(unsigned int nid, unsigned long start_pfn,
|
|||
nid, start_pfn, end_pfn,
|
||||
nr_nodemap_entries, MAX_ACTIVE_REGIONS);
|
||||
|
||||
mminit_validate_memmodel_limits(&start_pfn, &end_pfn);
|
||||
|
||||
/* Merge with existing active regions if possible */
|
||||
for (i = 0; i < nr_nodemap_entries; i++) {
|
||||
if (early_node_map[i].nid != nid)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue