aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2006-01-11 16:46:57 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-11 22:05:03 -0500
commit6c5acd160a10c76e8debf4f8fa8256d7c914f290 (patch)
treec13c1d282ad2bce8a6556d5d517879bf5b4343c7 /arch/x86_64
parent0a9c3ee7692fa20670986bcf550950e88ab9b4cc (diff)
[PATCH] x86_64: Allow kernel page tables upto the end of memory
Previously they would be only allocated before the kernel text at 1MB. This limited the maximum supported memory to 128GB. Now allow the e820 allocator to put them everywhere. Try to put them beyond any DMA zones to avoid filling them up. This should free some GFP_DMA memory compared to earlier kernels. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64')
-rw-r--r--arch/x86_64/mm/init.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c
index e93867850a4f..eca60125efc3 100644
--- a/arch/x86_64/mm/init.c
+++ b/arch/x86_64/mm/init.c
@@ -255,14 +255,26 @@ static void __init phys_pud_init(pud_t *pud, unsigned long address, unsigned lon
255 255
256static void __init find_early_table_space(unsigned long end) 256static void __init find_early_table_space(unsigned long end)
257{ 257{
258 unsigned long puds, pmds, tables; 258 unsigned long puds, pmds, tables, start;
259 259
260 puds = (end + PUD_SIZE - 1) >> PUD_SHIFT; 260 puds = (end + PUD_SIZE - 1) >> PUD_SHIFT;
261 pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT; 261 pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT;
262 tables = round_up(puds * sizeof(pud_t), PAGE_SIZE) + 262 tables = round_up(puds * sizeof(pud_t), PAGE_SIZE) +
263 round_up(pmds * sizeof(pmd_t), PAGE_SIZE); 263 round_up(pmds * sizeof(pmd_t), PAGE_SIZE);
264 264
265 table_start = find_e820_area(0x8000, __pa_symbol(&_text), tables); 265 /* Put page tables beyond the DMA zones if possible.
266 RED-PEN might be better to spread them out more over
267 memory to avoid hotspots */
268 if (end > MAX_DMA32_PFN<<PAGE_SHIFT)
269 start = MAX_DMA32_PFN << PAGE_SHIFT;
270 else if (end > MAX_DMA_PFN << PAGE_SHIFT)
271 start = MAX_DMA_PFN << PAGE_SHIFT;
272 else
273 start = 0x8000;
274
275 table_start = find_e820_area(start, end, tables);
276 if (table_start == -1)
277 table_start = find_e820_area(0x8000, end, tables);
266 if (table_start == -1UL) 278 if (table_start == -1UL)
267 panic("Cannot find space for the kernel page tables"); 279 panic("Cannot find space for the kernel page tables");
268 280