From dec0284fbdd36837ef67d0074bb6f9e1c68e0713 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Wed, 11 Jan 2006 22:46:57 +0100 Subject: [PATCH] --- yaml --- r: 18017 b: refs/heads/master c: 6c5acd160a10c76e8debf4f8fa8256d7c914f290 h: refs/heads/master i: 18015: 6cfd7d5aba3893ac5da790468c261180bf19d4af v: v3 --- [refs] | 2 +- trunk/arch/x86_64/mm/init.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index a27f152aee18..7cb78cf8bb46 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0a9c3ee7692fa20670986bcf550950e88ab9b4cc +refs/heads/master: 6c5acd160a10c76e8debf4f8fa8256d7c914f290 diff --git a/trunk/arch/x86_64/mm/init.c b/trunk/arch/x86_64/mm/init.c index e93867850a4f..eca60125efc3 100644 --- a/trunk/arch/x86_64/mm/init.c +++ b/trunk/arch/x86_64/mm/init.c @@ -255,14 +255,26 @@ static void __init phys_pud_init(pud_t *pud, unsigned long address, unsigned lon static void __init find_early_table_space(unsigned long end) { - unsigned long puds, pmds, tables; + unsigned long puds, pmds, tables, start; puds = (end + PUD_SIZE - 1) >> PUD_SHIFT; pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT; tables = round_up(puds * sizeof(pud_t), PAGE_SIZE) + round_up(pmds * sizeof(pmd_t), PAGE_SIZE); - table_start = find_e820_area(0x8000, __pa_symbol(&_text), tables); + /* Put page tables beyond the DMA zones if possible. + RED-PEN might be better to spread them out more over + memory to avoid hotspots */ + if (end > MAX_DMA32_PFN< MAX_DMA_PFN << PAGE_SHIFT) + start = MAX_DMA_PFN << PAGE_SHIFT; + else + start = 0x8000; + + table_start = find_e820_area(start, end, tables); + if (table_start == -1) + table_start = find_e820_area(0x8000, end, tables); if (table_start == -1UL) panic("Cannot find space for the kernel page tables");