Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138666
b: refs/heads/master
c: 49a2bf7
h: refs/heads/master
v: v3
  • Loading branch information
Pekka Enberg authored and Ingo Molnar committed Mar 5, 2009
1 parent f077f06 commit b3dec36
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4bbd4fa03832208f0e6e0b9e73a0ffa2620a626a
refs/heads/master: 49a2bf7303b0dc5fccbb3ff7cf2e7751f0e3953d
9 changes: 9 additions & 0 deletions trunk/arch/x86/mm/init_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -855,24 +855,33 @@ static void __init find_early_table_space(unsigned long end, int use_pse,
unsigned long extra;

extra = end - ((end>>PMD_SHIFT) << PMD_SHIFT);
#ifdef CONFIG_X86_32
extra += PMD_SIZE;
#endif
ptes = (extra + PAGE_SIZE - 1) >> PAGE_SHIFT;
} else
ptes = (end + PAGE_SIZE - 1) >> PAGE_SHIFT;

tables += roundup(ptes * sizeof(pte_t), PAGE_SIZE);

#ifdef CONFIG_X86_32
/* for fixmap */
tables += roundup(__end_of_fixed_addresses * sizeof(pte_t), PAGE_SIZE);
#endif

/*
* RED-PEN putting page tables only on node 0 could
* cause a hotspot and fill up ZONE_DMA. The page tables
* need roughly 0.5KB per GB.
*/
#ifdef CONFIG_X86_32
start = 0x7000;
table_start = find_e820_area(start, max_pfn_mapped<<PAGE_SHIFT,
tables, PAGE_SIZE);
#else /* CONFIG_X86_64 */
start = 0x8000;
table_start = find_e820_area(start, end, tables, PAGE_SIZE);
#endif
if (table_start == -1UL)
panic("Cannot find space for the kernel page tables");

Expand Down
14 changes: 14 additions & 0 deletions trunk/arch/x86/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,19 +569,33 @@ static void __init find_early_table_space(unsigned long end, int use_pse,
unsigned long extra;

extra = end - ((end>>PMD_SHIFT) << PMD_SHIFT);
#ifdef CONFIG_X86_32
extra += PMD_SIZE;
#endif
ptes = (extra + PAGE_SIZE - 1) >> PAGE_SHIFT;
} else
ptes = (end + PAGE_SIZE - 1) >> PAGE_SHIFT;

tables += roundup(ptes * sizeof(pte_t), PAGE_SIZE);

#ifdef CONFIG_X86_32
/* for fixmap */
tables += roundup(__end_of_fixed_addresses * sizeof(pte_t), PAGE_SIZE);
#endif

/*
* RED-PEN putting page tables only on node 0 could
* cause a hotspot and fill up ZONE_DMA. The page tables
* need roughly 0.5KB per GB.
*/
#ifdef CONFIG_X86_32
start = 0x7000;
table_start = find_e820_area(start, max_pfn_mapped<<PAGE_SHIFT,
tables, PAGE_SIZE);
#else /* CONFIG_X86_64 */
start = 0x8000;
table_start = find_e820_area(start, end, tables, PAGE_SIZE);
#endif
if (table_start == -1UL)
panic("Cannot find space for the kernel page tables");

Expand Down

0 comments on commit b3dec36

Please sign in to comment.