Re: [PATCH -v3 14/14] x86, mm: Map ISA area with connected ram range at the same time
On Thu, Sep 06, 2012 at 10:22:19AM +0300, Pekka Enberg wrote: > On Wed, Sep 5, 2012 at 1:02 AM, Pekka Enberg wrote: > > > How significant is the speed gain? The "isa_done" flag makes code flow > > > more difficult to follow. > > On Wed, 5 Sep 2012, Yinghai Lu wrote: > > Not really much. > > > > when booting system: > > memmap=16m$128m memmap=16m$512m memmap=16m$256m memmap=16m$768m > > memmap=16m$1024m > > > > with the patch > > [0.00] init_memory_mapping: [mem 0x-0x07ff] > > [0.00] [mem 0x-0x07ff] page 2M > > [0.00] init_memory_mapping: [mem 0x0900-0x0fff] > > [0.00] [mem 0x0900-0x0fff] page 2M > > [0.00] init_memory_mapping: [mem 0x1100-0x1fff] > > [0.00] [mem 0x1100-0x1fff] page 2M > > [0.00] init_memory_mapping: [mem 0x2100-0x2fff] > > [0.00] [mem 0x2100-0x2fff] page 2M > > [0.00] init_memory_mapping: [mem 0x3100-0x3fff] > > [0.00] [mem 0x3100-0x3fff] page 2M > > [0.00] init_memory_mapping: [mem 0x4100-0x7fffdfff] > > [0.00] [mem 0x4100-0x7fdf] page 2M > > [0.00] [mem 0x7fe0-0x7fffdfff] page 4k > > > > otherwise will have > > > > [0.00] init_memory_mapping: [mem 0x-0x000f] > > [0.00] [mem 0x-0x000f] page 4k > > [0.00] init_memory_mapping: [mem 0x0010-0x07ff] > > [0.00] [mem 0x0010-0x001f] page 4k > > [0.00] [mem 0x0020-0x07ff] page 2M > > [0.00] init_memory_mapping: [mem 0x0900-0x0fff] > > [0.00] [mem 0x0900-0x0fff] page 2M > > [0.00] init_memory_mapping: [mem 0x1100-0x1fff] > > [0.00] [mem 0x1100-0x1fff] page 2M > > [0.00] init_memory_mapping: [mem 0x2100-0x2fff] > > [0.00] [mem 0x2100-0x2fff] page 2M > > [0.00] init_memory_mapping: [mem 0x3100-0x3fff] > > [0.00] [mem 0x3100-0x3fff] page 2M > > [0.00] init_memory_mapping: [mem 0x4100-0x7fffdfff] > > [0.00] [mem 0x4100-0x7fdf] page 2M > > [0.00] [mem 0x7fe0-0x7fffdfff] page 4k > > OK. Is there any other reason than performance to do this? May be minor, but .. The first range [mem 0x-0x07ff] is covered entirely by 2M page tables, instead of some 4K + some 2M. -Jacob > > Pekka > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH -v3 14/14] x86, mm: Map ISA area with connected ram range at the same time
On Wed, Sep 5, 2012 at 1:02 AM, Pekka Enberg wrote: > > How significant is the speed gain? The "isa_done" flag makes code flow > > more difficult to follow. On Wed, 5 Sep 2012, Yinghai Lu wrote: > Not really much. > > when booting system: > memmap=16m$128m memmap=16m$512m memmap=16m$256m memmap=16m$768m > memmap=16m$1024m > > with the patch > [0.00] init_memory_mapping: [mem 0x-0x07ff] > [0.00] [mem 0x-0x07ff] page 2M > [0.00] init_memory_mapping: [mem 0x0900-0x0fff] > [0.00] [mem 0x0900-0x0fff] page 2M > [0.00] init_memory_mapping: [mem 0x1100-0x1fff] > [0.00] [mem 0x1100-0x1fff] page 2M > [0.00] init_memory_mapping: [mem 0x2100-0x2fff] > [0.00] [mem 0x2100-0x2fff] page 2M > [0.00] init_memory_mapping: [mem 0x3100-0x3fff] > [0.00] [mem 0x3100-0x3fff] page 2M > [0.00] init_memory_mapping: [mem 0x4100-0x7fffdfff] > [0.00] [mem 0x4100-0x7fdf] page 2M > [0.00] [mem 0x7fe0-0x7fffdfff] page 4k > > otherwise will have > > [0.00] init_memory_mapping: [mem 0x-0x000f] > [0.00] [mem 0x-0x000f] page 4k > [0.00] init_memory_mapping: [mem 0x0010-0x07ff] > [0.00] [mem 0x0010-0x001f] page 4k > [0.00] [mem 0x0020-0x07ff] page 2M > [0.00] init_memory_mapping: [mem 0x0900-0x0fff] > [0.00] [mem 0x0900-0x0fff] page 2M > [0.00] init_memory_mapping: [mem 0x1100-0x1fff] > [0.00] [mem 0x1100-0x1fff] page 2M > [0.00] init_memory_mapping: [mem 0x2100-0x2fff] > [0.00] [mem 0x2100-0x2fff] page 2M > [0.00] init_memory_mapping: [mem 0x3100-0x3fff] > [0.00] [mem 0x3100-0x3fff] page 2M > [0.00] init_memory_mapping: [mem 0x4100-0x7fffdfff] > [0.00] [mem 0x4100-0x7fdf] page 2M > [0.00] [mem 0x7fe0-0x7fffdfff] page 4k OK. Is there any other reason than performance to do this? Pekka -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH -v3 14/14] x86, mm: Map ISA area with connected ram range at the same time
On Wed, Sep 5, 2012 at 1:02 AM, Pekka Enberg penb...@kernel.org wrote: How significant is the speed gain? The isa_done flag makes code flow more difficult to follow. On Wed, 5 Sep 2012, Yinghai Lu wrote: Not really much. when booting system: memmap=16m$128m memmap=16m$512m memmap=16m$256m memmap=16m$768m memmap=16m$1024m with the patch [0.00] init_memory_mapping: [mem 0x-0x07ff] [0.00] [mem 0x-0x07ff] page 2M [0.00] init_memory_mapping: [mem 0x0900-0x0fff] [0.00] [mem 0x0900-0x0fff] page 2M [0.00] init_memory_mapping: [mem 0x1100-0x1fff] [0.00] [mem 0x1100-0x1fff] page 2M [0.00] init_memory_mapping: [mem 0x2100-0x2fff] [0.00] [mem 0x2100-0x2fff] page 2M [0.00] init_memory_mapping: [mem 0x3100-0x3fff] [0.00] [mem 0x3100-0x3fff] page 2M [0.00] init_memory_mapping: [mem 0x4100-0x7fffdfff] [0.00] [mem 0x4100-0x7fdf] page 2M [0.00] [mem 0x7fe0-0x7fffdfff] page 4k otherwise will have [0.00] init_memory_mapping: [mem 0x-0x000f] [0.00] [mem 0x-0x000f] page 4k [0.00] init_memory_mapping: [mem 0x0010-0x07ff] [0.00] [mem 0x0010-0x001f] page 4k [0.00] [mem 0x0020-0x07ff] page 2M [0.00] init_memory_mapping: [mem 0x0900-0x0fff] [0.00] [mem 0x0900-0x0fff] page 2M [0.00] init_memory_mapping: [mem 0x1100-0x1fff] [0.00] [mem 0x1100-0x1fff] page 2M [0.00] init_memory_mapping: [mem 0x2100-0x2fff] [0.00] [mem 0x2100-0x2fff] page 2M [0.00] init_memory_mapping: [mem 0x3100-0x3fff] [0.00] [mem 0x3100-0x3fff] page 2M [0.00] init_memory_mapping: [mem 0x4100-0x7fffdfff] [0.00] [mem 0x4100-0x7fdf] page 2M [0.00] [mem 0x7fe0-0x7fffdfff] page 4k OK. Is there any other reason than performance to do this? Pekka -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH -v3 14/14] x86, mm: Map ISA area with connected ram range at the same time
On Thu, Sep 06, 2012 at 10:22:19AM +0300, Pekka Enberg wrote: On Wed, Sep 5, 2012 at 1:02 AM, Pekka Enberg penb...@kernel.org wrote: How significant is the speed gain? The isa_done flag makes code flow more difficult to follow. On Wed, 5 Sep 2012, Yinghai Lu wrote: Not really much. when booting system: memmap=16m$128m memmap=16m$512m memmap=16m$256m memmap=16m$768m memmap=16m$1024m with the patch [0.00] init_memory_mapping: [mem 0x-0x07ff] [0.00] [mem 0x-0x07ff] page 2M [0.00] init_memory_mapping: [mem 0x0900-0x0fff] [0.00] [mem 0x0900-0x0fff] page 2M [0.00] init_memory_mapping: [mem 0x1100-0x1fff] [0.00] [mem 0x1100-0x1fff] page 2M [0.00] init_memory_mapping: [mem 0x2100-0x2fff] [0.00] [mem 0x2100-0x2fff] page 2M [0.00] init_memory_mapping: [mem 0x3100-0x3fff] [0.00] [mem 0x3100-0x3fff] page 2M [0.00] init_memory_mapping: [mem 0x4100-0x7fffdfff] [0.00] [mem 0x4100-0x7fdf] page 2M [0.00] [mem 0x7fe0-0x7fffdfff] page 4k otherwise will have [0.00] init_memory_mapping: [mem 0x-0x000f] [0.00] [mem 0x-0x000f] page 4k [0.00] init_memory_mapping: [mem 0x0010-0x07ff] [0.00] [mem 0x0010-0x001f] page 4k [0.00] [mem 0x0020-0x07ff] page 2M [0.00] init_memory_mapping: [mem 0x0900-0x0fff] [0.00] [mem 0x0900-0x0fff] page 2M [0.00] init_memory_mapping: [mem 0x1100-0x1fff] [0.00] [mem 0x1100-0x1fff] page 2M [0.00] init_memory_mapping: [mem 0x2100-0x2fff] [0.00] [mem 0x2100-0x2fff] page 2M [0.00] init_memory_mapping: [mem 0x3100-0x3fff] [0.00] [mem 0x3100-0x3fff] page 2M [0.00] init_memory_mapping: [mem 0x4100-0x7fffdfff] [0.00] [mem 0x4100-0x7fdf] page 2M [0.00] [mem 0x7fe0-0x7fffdfff] page 4k OK. Is there any other reason than performance to do this? May be minor, but .. The first range [mem 0x-0x07ff] is covered entirely by 2M page tables, instead of some 4K + some 2M. -Jacob Pekka -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH -v3 14/14] x86, mm: Map ISA area with connected ram range at the same time
On Wed, Sep 5, 2012 at 1:02 AM, Pekka Enberg wrote: > > How significant is the speed gain? The "isa_done" flag makes code flow > more difficult to follow. Not really much. when booting system: memmap=16m$128m memmap=16m$512m memmap=16m$256m memmap=16m$768m memmap=16m$1024m with the patch [0.00] init_memory_mapping: [mem 0x-0x07ff] [0.00] [mem 0x-0x07ff] page 2M [0.00] init_memory_mapping: [mem 0x0900-0x0fff] [0.00] [mem 0x0900-0x0fff] page 2M [0.00] init_memory_mapping: [mem 0x1100-0x1fff] [0.00] [mem 0x1100-0x1fff] page 2M [0.00] init_memory_mapping: [mem 0x2100-0x2fff] [0.00] [mem 0x2100-0x2fff] page 2M [0.00] init_memory_mapping: [mem 0x3100-0x3fff] [0.00] [mem 0x3100-0x3fff] page 2M [0.00] init_memory_mapping: [mem 0x4100-0x7fffdfff] [0.00] [mem 0x4100-0x7fdf] page 2M [0.00] [mem 0x7fe0-0x7fffdfff] page 4k otherwise will have [0.00] init_memory_mapping: [mem 0x-0x000f] [0.00] [mem 0x-0x000f] page 4k [0.00] init_memory_mapping: [mem 0x0010-0x07ff] [0.00] [mem 0x0010-0x001f] page 4k [0.00] [mem 0x0020-0x07ff] page 2M [0.00] init_memory_mapping: [mem 0x0900-0x0fff] [0.00] [mem 0x0900-0x0fff] page 2M [0.00] init_memory_mapping: [mem 0x1100-0x1fff] [0.00] [mem 0x1100-0x1fff] page 2M [0.00] init_memory_mapping: [mem 0x2100-0x2fff] [0.00] [mem 0x2100-0x2fff] page 2M [0.00] init_memory_mapping: [mem 0x3100-0x3fff] [0.00] [mem 0x3100-0x3fff] page 2M [0.00] init_memory_mapping: [mem 0x4100-0x7fffdfff] [0.00] [mem 0x4100-0x7fdf] page 2M [0.00] [mem 0x7fe0-0x7fffdfff] page 4k -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH -v3 14/14] x86, mm: Map ISA area with connected ram range at the same time
On Wed, Sep 5, 2012 at 8:46 AM, Yinghai Lu wrote: > so could reduce one loop. > > Signed-off-by: Yinghai Lu How significant is the speed gain? The "isa_done" flag makes code flow more difficult to follow. > --- > arch/x86/mm/init.c | 21 ++--- > 1 files changed, 14 insertions(+), 7 deletions(-) > > diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c > index 6663f61..e69f832 100644 > --- a/arch/x86/mm/init.c > +++ b/arch/x86/mm/init.c > @@ -248,20 +248,27 @@ static void __init walk_ram_ranges( > void *data) > { > unsigned long start_pfn, end_pfn; > + bool isa_done = false; > int i; > > - /* the ISA range is always mapped regardless of memory holes */ > - work_fn(0, ISA_END_ADDRESS, data); > - > for_each_mem_pfn_range(i, MAX_NUMNODES, _pfn, _pfn, NULL) { > u64 start = start_pfn << PAGE_SHIFT; > u64 end = end_pfn << PAGE_SHIFT; > > - if (end <= ISA_END_ADDRESS) > - continue; > + if (!isa_done && start > ISA_END_ADDRESS) { > + work_fn(0, ISA_END_ADDRESS, data); > + isa_done = true; > + } else { > + if (end < ISA_END_ADDRESS) > + continue; > + > + if (start <= ISA_END_ADDRESS && > + end >= ISA_END_ADDRESS) { > + start = 0; > + isa_done = true; > + } > + } > > - if (start < ISA_END_ADDRESS) > - start = ISA_END_ADDRESS; > #ifdef CONFIG_X86_32 > /* on 32 bit, we only map up to max_low_pfn */ > if ((start >> PAGE_SHIFT) >= max_low_pfn) > -- > 1.7.7 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH -v3 14/14] x86, mm: Map ISA area with connected ram range at the same time
On Wed, Sep 5, 2012 at 8:46 AM, Yinghai Lu ying...@kernel.org wrote: so could reduce one loop. Signed-off-by: Yinghai Lu ying...@kernel.org How significant is the speed gain? The isa_done flag makes code flow more difficult to follow. --- arch/x86/mm/init.c | 21 ++--- 1 files changed, 14 insertions(+), 7 deletions(-) diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index 6663f61..e69f832 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -248,20 +248,27 @@ static void __init walk_ram_ranges( void *data) { unsigned long start_pfn, end_pfn; + bool isa_done = false; int i; - /* the ISA range is always mapped regardless of memory holes */ - work_fn(0, ISA_END_ADDRESS, data); - for_each_mem_pfn_range(i, MAX_NUMNODES, start_pfn, end_pfn, NULL) { u64 start = start_pfn PAGE_SHIFT; u64 end = end_pfn PAGE_SHIFT; - if (end = ISA_END_ADDRESS) - continue; + if (!isa_done start ISA_END_ADDRESS) { + work_fn(0, ISA_END_ADDRESS, data); + isa_done = true; + } else { + if (end ISA_END_ADDRESS) + continue; + + if (start = ISA_END_ADDRESS + end = ISA_END_ADDRESS) { + start = 0; + isa_done = true; + } + } - if (start ISA_END_ADDRESS) - start = ISA_END_ADDRESS; #ifdef CONFIG_X86_32 /* on 32 bit, we only map up to max_low_pfn */ if ((start PAGE_SHIFT) = max_low_pfn) -- 1.7.7 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH -v3 14/14] x86, mm: Map ISA area with connected ram range at the same time
On Wed, Sep 5, 2012 at 1:02 AM, Pekka Enberg penb...@kernel.org wrote: How significant is the speed gain? The isa_done flag makes code flow more difficult to follow. Not really much. when booting system: memmap=16m$128m memmap=16m$512m memmap=16m$256m memmap=16m$768m memmap=16m$1024m with the patch [0.00] init_memory_mapping: [mem 0x-0x07ff] [0.00] [mem 0x-0x07ff] page 2M [0.00] init_memory_mapping: [mem 0x0900-0x0fff] [0.00] [mem 0x0900-0x0fff] page 2M [0.00] init_memory_mapping: [mem 0x1100-0x1fff] [0.00] [mem 0x1100-0x1fff] page 2M [0.00] init_memory_mapping: [mem 0x2100-0x2fff] [0.00] [mem 0x2100-0x2fff] page 2M [0.00] init_memory_mapping: [mem 0x3100-0x3fff] [0.00] [mem 0x3100-0x3fff] page 2M [0.00] init_memory_mapping: [mem 0x4100-0x7fffdfff] [0.00] [mem 0x4100-0x7fdf] page 2M [0.00] [mem 0x7fe0-0x7fffdfff] page 4k otherwise will have [0.00] init_memory_mapping: [mem 0x-0x000f] [0.00] [mem 0x-0x000f] page 4k [0.00] init_memory_mapping: [mem 0x0010-0x07ff] [0.00] [mem 0x0010-0x001f] page 4k [0.00] [mem 0x0020-0x07ff] page 2M [0.00] init_memory_mapping: [mem 0x0900-0x0fff] [0.00] [mem 0x0900-0x0fff] page 2M [0.00] init_memory_mapping: [mem 0x1100-0x1fff] [0.00] [mem 0x1100-0x1fff] page 2M [0.00] init_memory_mapping: [mem 0x2100-0x2fff] [0.00] [mem 0x2100-0x2fff] page 2M [0.00] init_memory_mapping: [mem 0x3100-0x3fff] [0.00] [mem 0x3100-0x3fff] page 2M [0.00] init_memory_mapping: [mem 0x4100-0x7fffdfff] [0.00] [mem 0x4100-0x7fdf] page 2M [0.00] [mem 0x7fe0-0x7fffdfff] page 4k -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH -v3 14/14] x86, mm: Map ISA area with connected ram range at the same time
so could reduce one loop. Signed-off-by: Yinghai Lu --- arch/x86/mm/init.c | 21 ++--- 1 files changed, 14 insertions(+), 7 deletions(-) diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index 6663f61..e69f832 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -248,20 +248,27 @@ static void __init walk_ram_ranges( void *data) { unsigned long start_pfn, end_pfn; + bool isa_done = false; int i; - /* the ISA range is always mapped regardless of memory holes */ - work_fn(0, ISA_END_ADDRESS, data); - for_each_mem_pfn_range(i, MAX_NUMNODES, _pfn, _pfn, NULL) { u64 start = start_pfn << PAGE_SHIFT; u64 end = end_pfn << PAGE_SHIFT; - if (end <= ISA_END_ADDRESS) - continue; + if (!isa_done && start > ISA_END_ADDRESS) { + work_fn(0, ISA_END_ADDRESS, data); + isa_done = true; + } else { + if (end < ISA_END_ADDRESS) + continue; + + if (start <= ISA_END_ADDRESS && + end >= ISA_END_ADDRESS) { + start = 0; + isa_done = true; + } + } - if (start < ISA_END_ADDRESS) - start = ISA_END_ADDRESS; #ifdef CONFIG_X86_32 /* on 32 bit, we only map up to max_low_pfn */ if ((start >> PAGE_SHIFT) >= max_low_pfn) -- 1.7.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH -v3 14/14] x86, mm: Map ISA area with connected ram range at the same time
so could reduce one loop. Signed-off-by: Yinghai Lu ying...@kernel.org --- arch/x86/mm/init.c | 21 ++--- 1 files changed, 14 insertions(+), 7 deletions(-) diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index 6663f61..e69f832 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -248,20 +248,27 @@ static void __init walk_ram_ranges( void *data) { unsigned long start_pfn, end_pfn; + bool isa_done = false; int i; - /* the ISA range is always mapped regardless of memory holes */ - work_fn(0, ISA_END_ADDRESS, data); - for_each_mem_pfn_range(i, MAX_NUMNODES, start_pfn, end_pfn, NULL) { u64 start = start_pfn PAGE_SHIFT; u64 end = end_pfn PAGE_SHIFT; - if (end = ISA_END_ADDRESS) - continue; + if (!isa_done start ISA_END_ADDRESS) { + work_fn(0, ISA_END_ADDRESS, data); + isa_done = true; + } else { + if (end ISA_END_ADDRESS) + continue; + + if (start = ISA_END_ADDRESS + end = ISA_END_ADDRESS) { + start = 0; + isa_done = true; + } + } - if (start ISA_END_ADDRESS) - start = ISA_END_ADDRESS; #ifdef CONFIG_X86_32 /* on 32 bit, we only map up to max_low_pfn */ if ((start PAGE_SHIFT) = max_low_pfn) -- 1.7.7 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/