diff options
| author | Steve French <sfrench@us.ibm.com> | 2008-04-17 19:38:45 -0400 |
|---|---|---|
| committer | Steve French <sfrench@us.ibm.com> | 2008-04-17 19:38:45 -0400 |
| commit | 20e673810c69d18bee2ed74d19af3806ec2504f5 (patch) | |
| tree | 7c22dc5246295a82f2688a23ae1c7f3a4f424302 /mm/sparse.c | |
| parent | 8d142137b4fe87188f211042b16a5993964226f9 (diff) | |
| parent | 4b119e21d0c66c22e8ca03df05d9de623d0eb50f (diff) | |
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'mm/sparse.c')
| -rw-r--r-- | mm/sparse.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mm/sparse.c b/mm/sparse.c index f6a43c09c322..98d6b39c3472 100644 --- a/mm/sparse.c +++ b/mm/sparse.c | |||
| @@ -149,8 +149,18 @@ static inline int sparse_early_nid(struct mem_section *section) | |||
| 149 | /* Record a memory area against a node. */ | 149 | /* Record a memory area against a node. */ |
| 150 | void __init memory_present(int nid, unsigned long start, unsigned long end) | 150 | void __init memory_present(int nid, unsigned long start, unsigned long end) |
| 151 | { | 151 | { |
| 152 | unsigned long max_arch_pfn = 1UL << (MAX_PHYSMEM_BITS-PAGE_SHIFT); | ||
| 152 | unsigned long pfn; | 153 | unsigned long pfn; |
| 153 | 154 | ||
| 155 | /* | ||
| 156 | * Sanity checks - do not allow an architecture to pass | ||
| 157 | * in larger pfns than the maximum scope of sparsemem: | ||
| 158 | */ | ||
| 159 | if (start >= max_arch_pfn) | ||
| 160 | return; | ||
| 161 | if (end >= max_arch_pfn) | ||
| 162 | end = max_arch_pfn; | ||
| 163 | |||
| 154 | start &= PAGE_SECTION_MASK; | 164 | start &= PAGE_SECTION_MASK; |
| 155 | for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) { | 165 | for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) { |
| 156 | unsigned long section = pfn_to_section_nr(pfn); | 166 | unsigned long section = pfn_to_section_nr(pfn); |
