aboutsummaryrefslogtreecommitdiffstats
path: root/mm/sparse.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-04-18 02:56:30 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-18 02:56:30 -0400
commit1e42198609d73ed1a9adcba2af275c24c2678420 (patch)
tree32fd4d9073bfc0f3909af8f9fb4bcff38951d01a /mm/sparse.c
parent794eb6bf20ebf992c040ea831cd3a9c64b0c1f7a (diff)
parent4b119e21d0c66c22e8ca03df05d9de623d0eb50f (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'mm/sparse.c')
-rw-r--r--mm/sparse.c10
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. */
150void __init memory_present(int nid, unsigned long start, unsigned long end) 150void __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);