direct-io.hg

changeset 14269:200d13363a38

linux x86/64: No need to pre-allocate all fixmap pagetables:
just those for bt_ioremap().
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Tue Mar 06 13:41:05 2007 +0000 (2007-03-06)
parents ae203b55e7c8
children af6293fd3134
files linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c	Tue Mar 06 11:53:37 2007 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c	Tue Mar 06 13:41:05 2007 +0000
     1.3 @@ -708,19 +708,22 @@ static void xen_finish_init_mapping(void
     1.4  		WARN_ON(HYPERVISOR_update_va_mapping(
     1.5  			start, __pte_ma(0), 0));
     1.6  
     1.7 -	/* Initialise all fixmap pagetables. Use 'start_pfn' allocator. */
     1.8 +	/* Allocate pte's for initial fixmaps from 'start_pfn' allocator. */
     1.9  	table_end = ~0UL;
    1.10 -	for (i = 0; i < __end_of_fixed_addresses; i++)
    1.11 +
    1.12 +	/*
    1.13 +	 * Prefetch pte's for the bt_ioremap() area. It gets used before the
    1.14 +	 * boot-time allocator is online, so allocate-on-demand would fail.
    1.15 +	 */
    1.16 +	for (i = FIX_BTMAP_END; i <= FIX_BTMAP_BEGIN; i++)
    1.17  		__set_fixmap(i, 0, __pgprot(0));
    1.18 -	table_end = start_pfn;
    1.19  
    1.20 -	/* Switch to the real shared_info page, and clear the
    1.21 -	 * dummy page. */
    1.22 +	/* Switch to the real shared_info page, and clear the dummy page. */
    1.23  	set_fixmap(FIX_SHARED_INFO, xen_start_info->shared_info);
    1.24  	HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO);
    1.25  	memset(empty_zero_page, 0, sizeof(empty_zero_page));
    1.26  
    1.27 -	/* Setup mapping of lower 1st MB */
    1.28 +	/* Set up mapping of lowest 1MB of physical memory. */
    1.29  	for (i = 0; i < NR_FIX_ISAMAPS; i++)
    1.30  		if (is_initial_xendomain())
    1.31  			set_fixmap(FIX_ISAMAP_BEGIN - i, i * PAGE_SIZE);
    1.32 @@ -729,6 +732,9 @@ static void xen_finish_init_mapping(void
    1.33  				     virt_to_mfn(empty_zero_page)
    1.34  				     << PAGE_SHIFT,
    1.35  				     PAGE_KERNEL_RO);
    1.36 +
    1.37 +	/* Disable the 'start_pfn' allocator. */
    1.38 +	table_end = start_pfn;
    1.39  }
    1.40  
    1.41  /* Setup the direct mapping of the physical memory at PAGE_OFFSET.