lkml.org 
[lkml]   [2006]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: 2.6.17-mm1
From
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 <mel@csn.ul.ie>
> 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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-26 17:04    [W:0.094 / U:1.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site