Re: [PATCH] x86: fix pte allocation in "x86: introduce init_memory_mapping for 32bit"

From: Yinghai Lu
Date: Tue Jun 24 2008 - 17:41:28 EST


On Tue, Jun 24, 2008 at 2:32 PM, Jeremy Fitzhardinge <jeremy@xxxxxxxx> wrote:
> The patch "x86: introduce init_memory_mapping for 32bit" does not allocate
> enough space for PTEs if the CPU does not implement PSE.
>
> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
> Cc: Yinghai Lu <yhlu.kernel@xxxxxxxxx>
> ---
> arch/x86/mm/init_32.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> ===================================================================
> --- a/arch/x86/mm/init_32.c
> +++ b/arch/x86/mm/init_32.c
> @@ -733,6 +733,11 @@
> pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT;
> tables += PAGE_ALIGN(pmds * sizeof(pmd_t));
>
> + if (!cpu_has_pse) {
> + int ptes = (end + PAGE_SIZE - 1) >> PAGE_SHIFT;
> + tables += PAGE_ALIGN(ptes * sizeof(pte_t));
> + }
> +
> /*
> * RED-PEN putting page tables only on node 0 could
> * cause a hotspot and fill up ZONE_DMA. The page tables
>
thanks.

my test system never use the area from table_start to table_end. and I
wonder why init_pgtable is that big..

YH
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/