All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH] remove zone_mem_map [3/4] pfn_to_page()
@ 2006-02-01  3:27 KAMEZAWA Hiroyuki
  2006-02-01  5:07 ` Martin J. Bligh
  0 siblings, 1 reply; 4+ messages in thread
From: KAMEZAWA Hiroyuki @ 2006-02-01  3:27 UTC (permalink / raw)
  To: linux-mm; +Cc: Martin J. Bligh

Replace page_to_pfn() functions which uses zone->zone_mem_map.

Although pfn_to_page() uses node->node_mem_map, page_to_pfn() uses
zone->zone_mem_map. I don't know why. This patch make page_to_pfn
use node->node_mem_map

x86_64 arch seems to want not to make page_to_pfn() inlined.
So, CONFIG_DONT_INLINE_PAGE_TO_PFN is added.
Other archs wants this ?


Signed-Off-By: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

Index: hogehoge/include/asm-i386/mmzone.h
===================================================================
--- hogehoge.orig/include/asm-i386/mmzone.h
+++ hogehoge/include/asm-i386/mmzone.h
@@ -93,14 +93,6 @@ static inline int pfn_to_nid(unsigned lo
  	&NODE_DATA(__node)->node_mem_map[node_localnr(__pfn,__node)];	\
  })

-#define page_to_pfn(pg)							\
-({									\
-	struct page *__page = pg;					\
-	struct zone *__zone = page_zone(__page);			\
-	(unsigned long)(__page - __zone->zone_mem_map)			\
-		+ __zone->zone_start_pfn;				\
-})
-
  #ifdef CONFIG_X86_NUMAQ            /* we have contiguous memory on NUMA-Q */
  #define pfn_valid(pfn)          ((pfn) < num_physpages)
  #else
Index: hogehoge/include/linux/mm.h
===================================================================
--- hogehoge.orig/include/linux/mm.h
+++ hogehoge/include/linux/mm.h
@@ -484,6 +484,17 @@ static inline struct pglist_data *page_n
  	return NODE_DATA(page_to_nid);
  }

+#if defined(CONFIG_FLAT_NODE_MEM_MAP) && !defined(HAVE_ARCH_PAGE_TO_PFN)
+#ifndef CONFIG_DONT_INLINE_PAGE_TO_PFN /* looks x86_64 people wants this */
+static inline unsigned long page_to_pfn(struct page *page)
+{
+	return (page - page_node(page)->node_mem_map) + page_node(page)->node_start_pfn;
+}
+#else
+extern unsigned long page_to_pfn(struct page *page);
+#endif
+#endif
+
  static inline unsigned long page_to_section(struct page *page)
  {
  	return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK;
Index: hogehoge/include/asm-alpha/mmzone.h
===================================================================
--- hogehoge.orig/include/asm-alpha/mmzone.h
+++ hogehoge/include/asm-alpha/mmzone.h
@@ -86,8 +86,7 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p,
  	pte_t pte;                                                           \
  	unsigned long pfn;                                                   \
  									     \
-	pfn = ((unsigned long)((page)-page_zone(page)->zone_mem_map)) << 32; \
-	pfn += page_zone(page)->zone_start_pfn << 32;			     \
+	pfn = page_to_pfn(page) << 32; \
  	pte_val(pte) = pfn | pgprot_val(pgprot);			     \
  									     \
  	pte;								     \
@@ -110,13 +109,9 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p,
  	(NODE_DATA(kvaddr_to_nid(kaddr))->node_mem_map + local_mapnr(kaddr));	\
  })

-#define page_to_pfn(page)						\
-	((page) - page_zone(page)->zone_mem_map +			\
-	 (page_zone(page)->zone_start_pfn))

  #define page_to_pa(page)						\
-	((( (page) - page_zone(page)->zone_mem_map )			\
-	+ page_zone(page)->zone_start_pfn) << PAGE_SHIFT)
+	(page_to_pfn(page) << PAGE_SHIFT)

  #define pfn_to_nid(pfn)		pa_to_nid(((u64)(pfn) << PAGE_SHIFT))
  #define pfn_valid(pfn)							\
Index: hogehoge/include/asm-arm/memory.h
===================================================================
--- hogehoge.orig/include/asm-arm/memory.h
+++ hogehoge/include/asm-arm/memory.h
@@ -190,9 +190,7 @@ static inline __deprecated void *bus_to_
   */
  #include <linux/numa.h>

-#define page_to_pfn(page)					\
-	(( (page) - page_zone(page)->zone_mem_map)		\
-	  + page_zone(page)->zone_start_pfn)
+/* page_to_pfn is defined in include/linux/mm.h */

  #define pfn_to_page(pfn)					\
  	(PFN_TO_MAPBASE(pfn) + LOCAL_MAP_NR((pfn) << PAGE_SHIFT))
Index: hogehoge/include/asm-m32r/mmzone.h
===================================================================
--- hogehoge.orig/include/asm-m32r/mmzone.h
+++ hogehoge/include/asm-m32r/mmzone.h
@@ -28,13 +28,6 @@ extern struct pglist_data *node_data[];
  	&NODE_DATA(__node)->node_mem_map[node_localnr(__pfn,__node)];	\
  })

-#define page_to_pfn(pg)							\
-({									\
-	struct page *__page = pg;					\
-	struct zone *__zone = page_zone(__page);			\
-	(unsigned long)(__page - __zone->zone_mem_map)			\
-		+ __zone->zone_start_pfn;				\
-})
  #define pmd_page(pmd)		(pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
  /*
   * pfn_valid should be made as fast as possible, and the current definition
Index: hogehoge/include/asm-mips/mmzone.h
===================================================================
--- hogehoge.orig/include/asm-mips/mmzone.h
+++ hogehoge/include/asm-mips/mmzone.h
@@ -29,13 +29,6 @@
  	__pg->node_mem_map + (__pfn - __pg->node_start_pfn);	\
  })

-#define page_to_pfn(p)						\
-({								\
-	struct page *__p = (p);					\
-	struct zone *__z = page_zone(__p);			\
-	((__p - __z->zone_mem_map) + __z->zone_start_pfn);	\
-})
-
  /* XXX: FIXME -- wli */
  #define kern_addr_valid(addr)	(0)

Index: hogehoge/include/asm-parisc/mmzone.h
===================================================================
--- hogehoge.orig/include/asm-parisc/mmzone.h
+++ hogehoge/include/asm-parisc/mmzone.h
@@ -34,14 +34,6 @@ extern struct node_map_data node_data[];
  	&NODE_DATA(__node)->node_mem_map[node_localnr(__pfn,__node)];	\
  })

-#define page_to_pfn(pg)							\
-({									\
-	struct page *__page = pg;					\
-	struct zone *__zone = page_zone(__page);			\
-	BUG_ON(__zone == NULL);						\
-	(unsigned long)(__page - __zone->zone_mem_map)			\
-		+ __zone->zone_start_pfn;				\
-})

  /* We have these possible memory map layouts:
   * Astro: 0-3.75, 67.75-68, 4-64
Index: hogehoge/arch/x86_64/Kconfig
===================================================================
--- hogehoge.orig/arch/x86_64/Kconfig
+++ hogehoge/arch/x86_64/Kconfig
@@ -321,6 +321,10 @@ config HAVE_ARCH_EARLY_PFN_TO_NID
  	def_bool y
  	depends on NUMA

+config DONT_INLINE_PAGE_TO_PFN
+	def_bool y
+	depends on NUMA
+
  config NR_CPUS
  	int "Maximum number of CPUs (2-256)"
  	range 2 256
Index: hogehoge/arch/x86_64/mm/numa.c
===================================================================
--- hogehoge.orig/arch/x86_64/mm/numa.c
+++ hogehoge/arch/x86_64/mm/numa.c
@@ -379,8 +379,8 @@ EXPORT_SYMBOL(pfn_to_page);

  unsigned long page_to_pfn(struct page *page)
  {
-	return (long)(((page) - page_zone(page)->zone_mem_map) +
-		      page_zone(page)->zone_start_pfn);
+	return (long)(((page) - page_node(page)->node_mem_map) +
+		      page_node(page)->node_start_pfn);
  }
  EXPORT_SYMBOL(page_to_pfn);

Index: hogehoge/mm/page_alloc.c
===================================================================
--- hogehoge.orig/mm/page_alloc.c
+++ hogehoge/mm/page_alloc.c
@@ -2712,3 +2712,13 @@ void *__init alloc_large_system_hash(con

  	return table;
  }
+
+/* inlined version is in include/linux/mm.h */
+#if defined(CONFIG_NODE_FLAT_MEM_MAP) && defined(CONFIG_DISCONTIG_MEM)
+#ifdef DONT_INLINE_PAGE_TO_PFN
+unsigned long page_to_pfn(struct page *page)
+{
+	return (page - page_node(page)->node_mem_map) + page_node(page)->node_start_pfn;
+}
+#endif
+#endif
Index: hogehoge/arch/ia64/Kconfig
===================================================================
--- hogehoge.orig/arch/ia64/Kconfig
+++ hogehoge/arch/ia64/Kconfig
@@ -330,6 +330,10 @@ config VIRTUAL_MEM_MAP
  	  require the DISCONTIGMEM option for your machine. If you are
  	  unsure, say Y.

+config HAVE_ARCH_PAGE_TO_PFN
+	default y
+	if VIRTUAL_MEM_MAP
+
  config HOLES_IN_ZONE
  	bool
  	default y if VIRTUAL_MEM_MAP
Index: hogehoge/mm/Kconfig
===================================================================
--- hogehoge.orig/mm/Kconfig
+++ hogehoge/mm/Kconfig
@@ -77,6 +77,10 @@ config FLAT_NODE_MEM_MAP
  	def_bool y
  	depends on !SPARSEMEM

+config HAVE_ARCH_PAGE_TO_PFN
+	def_bool y
+	depends on FLATMEM
+
  #
  # Both the NUMA code and DISCONTIGMEM use arrays of pg_data_t's
  # to represent different areas of memory.  This variable allows

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC][PATCH] remove zone_mem_map [3/4] pfn_to_page()
  2006-02-01  3:27 [RFC][PATCH] remove zone_mem_map [3/4] pfn_to_page() KAMEZAWA Hiroyuki
@ 2006-02-01  5:07 ` Martin J. Bligh
  2006-02-01  5:21   ` KAMEZAWA Hiroyuki
  2006-02-01 13:34   ` Andy Whitcroft
  0 siblings, 2 replies; 4+ messages in thread
From: Martin J. Bligh @ 2006-02-01  5:07 UTC (permalink / raw)
  To: KAMEZAWA Hiroyuki; +Cc: linux-mm, Andy Whitcroft

KAMEZAWA Hiroyuki wrote:
> Replace page_to_pfn() functions which uses zone->zone_mem_map.
> 
> Although pfn_to_page() uses node->node_mem_map, page_to_pfn() uses
> zone->zone_mem_map. I don't know why. This patch make page_to_pfn
> use node->node_mem_map

I think that might have been because it's a faster op, at least on
some architectures, under sparsemem. Andy, can you confirm / deny?
Some part of the mapping was embedded in the page flags.

If Andy can't recall, I'll look again on Thursday when I'm back ...

M.

> x86_64 arch seems to want not to make page_to_pfn() inlined.
> So, CONFIG_DONT_INLINE_PAGE_TO_PFN is added.
> Other archs wants this ?
 >
> 
> Signed-Off-By: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> 
> Index: hogehoge/include/asm-i386/mmzone.h
> ===================================================================
> --- hogehoge.orig/include/asm-i386/mmzone.h
> +++ hogehoge/include/asm-i386/mmzone.h
> @@ -93,14 +93,6 @@ static inline int pfn_to_nid(unsigned lo
>      &NODE_DATA(__node)->node_mem_map[node_localnr(__pfn,__node)];    \
>  })
> 
> -#define page_to_pfn(pg)                            \
> -({                                    \
> -    struct page *__page = pg;                    \
> -    struct zone *__zone = page_zone(__page);            \
> -    (unsigned long)(__page - __zone->zone_mem_map)            \
> -        + __zone->zone_start_pfn;                \
> -})
> -
>  #ifdef CONFIG_X86_NUMAQ            /* we have contiguous memory on 
> NUMA-Q */
>  #define pfn_valid(pfn)          ((pfn) < num_physpages)
>  #else
> Index: hogehoge/include/linux/mm.h
> ===================================================================
> --- hogehoge.orig/include/linux/mm.h
> +++ hogehoge/include/linux/mm.h
> @@ -484,6 +484,17 @@ static inline struct pglist_data *page_n
>      return NODE_DATA(page_to_nid);
>  }
> 
> +#if defined(CONFIG_FLAT_NODE_MEM_MAP) && !defined(HAVE_ARCH_PAGE_TO_PFN)
> +#ifndef CONFIG_DONT_INLINE_PAGE_TO_PFN /* looks x86_64 people wants 
> this */
> +static inline unsigned long page_to_pfn(struct page *page)
> +{
> +    return (page - page_node(page)->node_mem_map) + 
> page_node(page)->node_start_pfn;
> +}
> +#else
> +extern unsigned long page_to_pfn(struct page *page);
> +#endif
> +#endif
> +
>  static inline unsigned long page_to_section(struct page *page)
>  {
>      return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK;
> Index: hogehoge/include/asm-alpha/mmzone.h
> ===================================================================
> --- hogehoge.orig/include/asm-alpha/mmzone.h
> +++ hogehoge/include/asm-alpha/mmzone.h
> @@ -86,8 +86,7 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p,
>      pte_t pte;                                                           \
>      unsigned long pfn;                                                   \
>                                           \
> -    pfn = ((unsigned long)((page)-page_zone(page)->zone_mem_map)) << 32; \
> -    pfn += page_zone(page)->zone_start_pfn << 32;                 \
> +    pfn = page_to_pfn(page) << 32; \
>      pte_val(pte) = pfn | pgprot_val(pgprot);                 \
>                                           \
>      pte;                                     \
> @@ -110,13 +109,9 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p,
>      (NODE_DATA(kvaddr_to_nid(kaddr))->node_mem_map + 
> local_mapnr(kaddr));    \
>  })
> 
> -#define page_to_pfn(page)                        \
> -    ((page) - page_zone(page)->zone_mem_map +            \
> -     (page_zone(page)->zone_start_pfn))
> 
>  #define page_to_pa(page)                        \
> -    ((( (page) - page_zone(page)->zone_mem_map )            \
> -    + page_zone(page)->zone_start_pfn) << PAGE_SHIFT)
> +    (page_to_pfn(page) << PAGE_SHIFT)
> 
>  #define pfn_to_nid(pfn)        pa_to_nid(((u64)(pfn) << PAGE_SHIFT))
>  #define pfn_valid(pfn)                            \
> Index: hogehoge/include/asm-arm/memory.h
> ===================================================================
> --- hogehoge.orig/include/asm-arm/memory.h
> +++ hogehoge/include/asm-arm/memory.h
> @@ -190,9 +190,7 @@ static inline __deprecated void *bus_to_
>   */
>  #include <linux/numa.h>
> 
> -#define page_to_pfn(page)                    \
> -    (( (page) - page_zone(page)->zone_mem_map)        \
> -      + page_zone(page)->zone_start_pfn)
> +/* page_to_pfn is defined in include/linux/mm.h */
> 
>  #define pfn_to_page(pfn)                    \
>      (PFN_TO_MAPBASE(pfn) + LOCAL_MAP_NR((pfn) << PAGE_SHIFT))
> Index: hogehoge/include/asm-m32r/mmzone.h
> ===================================================================
> --- hogehoge.orig/include/asm-m32r/mmzone.h
> +++ hogehoge/include/asm-m32r/mmzone.h
> @@ -28,13 +28,6 @@ extern struct pglist_data *node_data[];
>      &NODE_DATA(__node)->node_mem_map[node_localnr(__pfn,__node)];    \
>  })
> 
> -#define page_to_pfn(pg)                            \
> -({                                    \
> -    struct page *__page = pg;                    \
> -    struct zone *__zone = page_zone(__page);            \
> -    (unsigned long)(__page - __zone->zone_mem_map)            \
> -        + __zone->zone_start_pfn;                \
> -})
>  #define pmd_page(pmd)        (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
>  /*
>   * pfn_valid should be made as fast as possible, and the current 
> definition
> Index: hogehoge/include/asm-mips/mmzone.h
> ===================================================================
> --- hogehoge.orig/include/asm-mips/mmzone.h
> +++ hogehoge/include/asm-mips/mmzone.h
> @@ -29,13 +29,6 @@
>      __pg->node_mem_map + (__pfn - __pg->node_start_pfn);    \
>  })
> 
> -#define page_to_pfn(p)                        \
> -({                                \
> -    struct page *__p = (p);                    \
> -    struct zone *__z = page_zone(__p);            \
> -    ((__p - __z->zone_mem_map) + __z->zone_start_pfn);    \
> -})
> -
>  /* XXX: FIXME -- wli */
>  #define kern_addr_valid(addr)    (0)
> 
> Index: hogehoge/include/asm-parisc/mmzone.h
> ===================================================================
> --- hogehoge.orig/include/asm-parisc/mmzone.h
> +++ hogehoge/include/asm-parisc/mmzone.h
> @@ -34,14 +34,6 @@ extern struct node_map_data node_data[];
>      &NODE_DATA(__node)->node_mem_map[node_localnr(__pfn,__node)];    \
>  })
> 
> -#define page_to_pfn(pg)                            \
> -({                                    \
> -    struct page *__page = pg;                    \
> -    struct zone *__zone = page_zone(__page);            \
> -    BUG_ON(__zone == NULL);                        \
> -    (unsigned long)(__page - __zone->zone_mem_map)            \
> -        + __zone->zone_start_pfn;                \
> -})
> 
>  /* We have these possible memory map layouts:
>   * Astro: 0-3.75, 67.75-68, 4-64
> Index: hogehoge/arch/x86_64/Kconfig
> ===================================================================
> --- hogehoge.orig/arch/x86_64/Kconfig
> +++ hogehoge/arch/x86_64/Kconfig
> @@ -321,6 +321,10 @@ config HAVE_ARCH_EARLY_PFN_TO_NID
>      def_bool y
>      depends on NUMA
> 
> +config DONT_INLINE_PAGE_TO_PFN
> +    def_bool y
> +    depends on NUMA
> +
>  config NR_CPUS
>      int "Maximum number of CPUs (2-256)"
>      range 2 256
> Index: hogehoge/arch/x86_64/mm/numa.c
> ===================================================================
> --- hogehoge.orig/arch/x86_64/mm/numa.c
> +++ hogehoge/arch/x86_64/mm/numa.c
> @@ -379,8 +379,8 @@ EXPORT_SYMBOL(pfn_to_page);
> 
>  unsigned long page_to_pfn(struct page *page)
>  {
> -    return (long)(((page) - page_zone(page)->zone_mem_map) +
> -              page_zone(page)->zone_start_pfn);
> +    return (long)(((page) - page_node(page)->node_mem_map) +
> +              page_node(page)->node_start_pfn);
>  }
>  EXPORT_SYMBOL(page_to_pfn);
> 
> Index: hogehoge/mm/page_alloc.c
> ===================================================================
> --- hogehoge.orig/mm/page_alloc.c
> +++ hogehoge/mm/page_alloc.c
> @@ -2712,3 +2712,13 @@ void *__init alloc_large_system_hash(con
> 
>      return table;
>  }
> +
> +/* inlined version is in include/linux/mm.h */
> +#if defined(CONFIG_NODE_FLAT_MEM_MAP) && defined(CONFIG_DISCONTIG_MEM)
> +#ifdef DONT_INLINE_PAGE_TO_PFN
> +unsigned long page_to_pfn(struct page *page)
> +{
> +    return (page - page_node(page)->node_mem_map) + 
> page_node(page)->node_start_pfn;
> +}
> +#endif
> +#endif
> Index: hogehoge/arch/ia64/Kconfig
> ===================================================================
> --- hogehoge.orig/arch/ia64/Kconfig
> +++ hogehoge/arch/ia64/Kconfig
> @@ -330,6 +330,10 @@ config VIRTUAL_MEM_MAP
>        require the DISCONTIGMEM option for your machine. If you are
>        unsure, say Y.
> 
> +config HAVE_ARCH_PAGE_TO_PFN
> +    default y
> +    if VIRTUAL_MEM_MAP
> +
>  config HOLES_IN_ZONE
>      bool
>      default y if VIRTUAL_MEM_MAP
> Index: hogehoge/mm/Kconfig
> ===================================================================
> --- hogehoge.orig/mm/Kconfig
> +++ hogehoge/mm/Kconfig
> @@ -77,6 +77,10 @@ config FLAT_NODE_MEM_MAP
>      def_bool y
>      depends on !SPARSEMEM
> 
> +config HAVE_ARCH_PAGE_TO_PFN
> +    def_bool y
> +    depends on FLATMEM
> +
>  #
>  # Both the NUMA code and DISCONTIGMEM use arrays of pg_data_t's
>  # to represent different areas of memory.  This variable allows
> 
> 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC][PATCH] remove zone_mem_map [3/4] pfn_to_page()
  2006-02-01  5:07 ` Martin J. Bligh
@ 2006-02-01  5:21   ` KAMEZAWA Hiroyuki
  2006-02-01 13:34   ` Andy Whitcroft
  1 sibling, 0 replies; 4+ messages in thread
From: KAMEZAWA Hiroyuki @ 2006-02-01  5:21 UTC (permalink / raw)
  To: Martin J. Bligh; +Cc: linux-mm, Andy Whitcroft

Martin J. Bligh wrote:
> KAMEZAWA Hiroyuki wrote:
>> Replace page_to_pfn() functions which uses zone->zone_mem_map.
>>
>> Although pfn_to_page() uses node->node_mem_map, page_to_pfn() uses
>> zone->zone_mem_map. I don't know why. This patch make page_to_pfn
>> use node->node_mem_map
> 
> I think that might have been because it's a faster op, at least on
> some architectures, under sparsemem. Andy, can you confirm / deny?
> Some part of the mapping was embedded in the page flags.
> 
Under sparsemem, zone->zone_mem_map is meaningless.
The mem_map is not contiguous.

If NODE_DATA(nid) is slower than page_zone() , this change will be problem.
While page_zone() accesses global zone_table[], NODE_DATA(nid) depends on each
arch. Some archs has local NODE_DATA table.

> If Andy can't recall, I'll look again on Thursday when I'm back ...
> 
> M.
> 
Thank you!.

-Kame

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC][PATCH] remove zone_mem_map [3/4] pfn_to_page()
  2006-02-01  5:07 ` Martin J. Bligh
  2006-02-01  5:21   ` KAMEZAWA Hiroyuki
@ 2006-02-01 13:34   ` Andy Whitcroft
  1 sibling, 0 replies; 4+ messages in thread
From: Andy Whitcroft @ 2006-02-01 13:34 UTC (permalink / raw)
  To: Martin J. Bligh; +Cc: KAMEZAWA Hiroyuki, linux-mm

Martin J. Bligh wrote:
> KAMEZAWA Hiroyuki wrote:
> 
>> Replace page_to_pfn() functions which uses zone->zone_mem_map.
>>
>> Although pfn_to_page() uses node->node_mem_map, page_to_pfn() uses
>> zone->zone_mem_map. I don't know why. This patch make page_to_pfn
>> use node->node_mem_map
> 
> 
> I think that might have been because it's a faster op, at least on
> some architectures, under sparsemem. Andy, can you confirm / deny?
> Some part of the mapping was embedded in the page flags.
> 
> If Andy can't recall, I'll look again on Thursday when I'm back ...

Not for SPARSEMEM anyhow, we don't use any of those pointers we are
using the per section maps based on pfn.  However, I would assume we
have it as an optimisation for the FLAT/DISCONTIG forms -- as we have a
quick lookup of the zone.  That said we should have a quick lookup of
the node too and it looks like the proposed replacement is using that
one.  So I'd say this should be about as performant.

-apw

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-02-01 13:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-01  3:27 [RFC][PATCH] remove zone_mem_map [3/4] pfn_to_page() KAMEZAWA Hiroyuki
2006-02-01  5:07 ` Martin J. Bligh
2006-02-01  5:21   ` KAMEZAWA Hiroyuki
2006-02-01 13:34   ` Andy Whitcroft

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.