Mel Gorman wrote:
>
> Lets close this out first and then figure out where to go next. The following
> patch should fix the problem where mem_map is offset twice when ARCH_PFN_OFFSET
> != 0 and documents what ARCH_PFN_OFFSET is for.
>
why not dropping the initial patch, and resubmit the whole thing that
can be called an optimization rather than a fix ?
> Signed-off-by: Mel Gorman <[email protected]>
> diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.17-mm2-clean/include/asm-generic/memory_model.h linux-2.6.17-mm2-archpfnfix/include/asm-generic/memory_model.h
> --- linux-2.6.17-mm2-clean/include/asm-generic/memory_model.h 2006-06-26 11:38:21.000000000 +0100
> +++ linux-2.6.17-mm2-archpfnfix/include/asm-generic/memory_model.h 2006-06-26 15:22:19.000000000 +0100
> @@ -6,6 +6,20 @@
>
> #if defined(CONFIG_FLATMEM)
>
> +/*
> + * With FLATMEM, the mem_map on node 0 is used as the global mem_map.
> + * This implicitly assumes that NODE_DATA(0)->node_start_pfn == 0 and
> + * represents the first physical page frame in the system. This is not
> + * always the case as an architecture may start physical memory at 3GB
> + * for example. Rather than allocating an empty mem_map to represent
> + * the non-existent memory, ARCH_PFN_OFFSET is subtracted from
> + * NODE_DATA(0)->node_mem_map such that;
> + *
> + * PFN 0 = mem_map = NODE_DATA(0)->node_mem_map - ARCH_PFN_OFFSET
> + *
> + * One would expect NODE_DATA(0)->node_start_pfn == ARCH_PFN_OFFSET but
> + * depending on how memory is initialised, this is not always the case.
> + */
> #ifndef ARCH_PFN_OFFSET
> #define ARCH_PFN_OFFSET (0UL)
> #endif
> @@ -28,9 +42,8 @@
> */
> #if defined(CONFIG_FLATMEM)
>
> -#define __pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET))
> -#define __page_to_pfn(page) ((unsigned long)((page) - mem_map) + \
> - ARCH_PFN_OFFSET)
> +#define __pfn_to_page(pfn) (mem_map + (pfn))
> +#define __page_to_pfn(page) ((unsigned long)((page) - mem_map))
> #elif defined(CONFIG_DISCONTIGMEM)
>
> #define __pfn_to_page(pfn) \
> diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.17-mm2-clean/mm/page_alloc.c linux-2.6.17-mm2-archpfnfix/mm/page_alloc.c
> --- linux-2.6.17-mm2-clean/mm/page_alloc.c 2006-06-26 11:38:21.000000000 +0100
> +++ linux-2.6.17-mm2-archpfnfix/mm/page_alloc.c 2006-06-26 15:11:29.000000000 +0100
> @@ -2103,7 +2103,7 @@ static void __init alloc_node_mem_map(st
> * is true. Adjust map relative to node_mem_map to
> * maintain this relationship.
> */
> - map -= pgdat->node_start_pfn;
> + map -= ARCH_PFN_OFFSET;
why not moving this inside the if statement below ?
> }
> #ifdef CONFIG_FLATMEM
> /*
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]