aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/init_32.c
diff options
context:
space:
mode:
authorSuresh Siddha <suresh.b.siddha@intel.com>2008-09-23 17:00:39 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-10 13:29:14 -0400
commit0b8fdcbcd287a1fbe66817491e6149841ae25705 (patch)
treead140d2fc2603e095343ee7a135c95ad9621664c /arch/x86/mm/init_32.c
parenta2699e477b8e6b17d4da64916f766dd5a2576c9c (diff)
x86, cpa: dont use large pages for kernel identity mapping with DEBUG_PAGEALLOC
Don't use large pages for kernel identity mapping with DEBUG_PAGEALLOC. This will remove the need to split the large page for the allocated kernel page in the interrupt context. This will simplify cpa code(as we don't do the split any more from the interrupt context). cpa code simplication in the subsequent patches. Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Cc: Suresh Siddha <suresh.b.siddha@intel.com> Cc: arjan@linux.intel.com Cc: venkatesh.pallipadi@intel.com Cc: jeremy@goop.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm/init_32.c')
-rw-r--r--arch/x86/mm/init_32.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 9b5f7d7049d0..44ccb028c350 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -777,7 +777,7 @@ void __init setup_bootmem_allocator(void)
777 after_init_bootmem = 1; 777 after_init_bootmem = 1;
778} 778}
779 779
780static void __init find_early_table_space(unsigned long end) 780static void __init find_early_table_space(unsigned long end, int use_pse)
781{ 781{
782 unsigned long puds, pmds, ptes, tables, start; 782 unsigned long puds, pmds, ptes, tables, start;
783 783
@@ -787,7 +787,7 @@ static void __init find_early_table_space(unsigned long end)
787 pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT; 787 pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT;
788 tables += PAGE_ALIGN(pmds * sizeof(pmd_t)); 788 tables += PAGE_ALIGN(pmds * sizeof(pmd_t));
789 789
790 if (cpu_has_pse) { 790 if (use_pse) {
791 unsigned long extra; 791 unsigned long extra;
792 792
793 extra = end - ((end>>PMD_SHIFT) << PMD_SHIFT); 793 extra = end - ((end>>PMD_SHIFT) << PMD_SHIFT);
@@ -827,12 +827,22 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
827 pgd_t *pgd_base = swapper_pg_dir; 827 pgd_t *pgd_base = swapper_pg_dir;
828 unsigned long start_pfn, end_pfn; 828 unsigned long start_pfn, end_pfn;
829 unsigned long big_page_start; 829 unsigned long big_page_start;
830#ifdef CONFIG_DEBUG_PAGEALLOC
831 /*
832 * For CONFIG_DEBUG_PAGEALLOC, identity mapping will use small pages.
833 * This will simplify cpa(), which otherwise needs to support splitting
834 * large pages into small in interrupt context, etc.
835 */
836 int use_pse = 0;
837#else
838 int use_pse = cpu_has_pse;
839#endif
830 840
831 /* 841 /*
832 * Find space for the kernel direct mapping tables. 842 * Find space for the kernel direct mapping tables.
833 */ 843 */
834 if (!after_init_bootmem) 844 if (!after_init_bootmem)
835 find_early_table_space(end); 845 find_early_table_space(end, use_pse);
836 846
837#ifdef CONFIG_X86_PAE 847#ifdef CONFIG_X86_PAE
838 set_nx(); 848 set_nx();
@@ -878,7 +888,7 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
878 end_pfn = (end>>PMD_SHIFT) << (PMD_SHIFT - PAGE_SHIFT); 888 end_pfn = (end>>PMD_SHIFT) << (PMD_SHIFT - PAGE_SHIFT);
879 if (start_pfn < end_pfn) 889 if (start_pfn < end_pfn)
880 kernel_physical_mapping_init(pgd_base, start_pfn, end_pfn, 890 kernel_physical_mapping_init(pgd_base, start_pfn, end_pfn,
881 cpu_has_pse); 891 use_pse);
882 892
883 /* tail is not big page alignment ? */ 893 /* tail is not big page alignment ? */
884 start_pfn = end_pfn; 894 start_pfn = end_pfn;