public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] unify pfn_to_page take 2 [3/25] x86_64 funcs
@ 2006-02-08  5:46 KAMEZAWA Hiroyuki
  0 siblings, 0 replies; only message in thread
From: KAMEZAWA Hiroyuki @ 2006-02-08  5:46 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Andi Kleen

x86_64 can use generic one.
When DISCONTIGMEM is selected, CONFIG_DONT_INLINE_PFN_TO_PAGE=y.
pfn_to_page/page_to_pfn are not inlined.

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

Index: test-layout-free-zone/arch/x86_64/mm/numa.c
===================================================================
--- test-layout-free-zone.orig/arch/x86_64/mm/numa.c
+++ test-layout-free-zone/arch/x86_64/mm/numa.c
@@ -362,28 +362,6 @@ EXPORT_SYMBOL(memnodemap);
  EXPORT_SYMBOL(node_data);

  #ifdef CONFIG_DISCONTIGMEM
-/*
- * Functions to convert PFNs from/to per node page addresses.
- * These are out of line because they are quite big.
- * They could be all tuned by pre caching more state.
- * Should do that.
- */
-
-/* Requires pfn_valid(pfn) to be true */
-struct page *pfn_to_page(unsigned long pfn)
-{
-	int nid = phys_to_nid(((unsigned long)(pfn)) << PAGE_SHIFT);
-	return (pfn - node_start_pfn(nid)) + NODE_DATA(nid)->node_mem_map;
-}
-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);
-}
-EXPORT_SYMBOL(page_to_pfn);
-
  int pfn_valid(unsigned long pfn)
  {
  	unsigned nid;
Index: test-layout-free-zone/include/asm-x86_64/mmzone.h
===================================================================
--- test-layout-free-zone.orig/include/asm-x86_64/mmzone.h
+++ test-layout-free-zone/include/asm-x86_64/mmzone.h
@@ -39,8 +39,6 @@ static inline __attribute__((pure)) int
  #define pfn_to_nid(pfn) phys_to_nid((unsigned long)(pfn) << PAGE_SHIFT)
  #define kvaddr_to_nid(kaddr)	phys_to_nid(__pa(kaddr))

-extern struct page *pfn_to_page(unsigned long pfn);
-extern unsigned long page_to_pfn(struct page *page);
  extern int pfn_valid(unsigned long pfn);
  #endif

Index: test-layout-free-zone/include/asm-x86_64/page.h
===================================================================
--- test-layout-free-zone.orig/include/asm-x86_64/page.h
+++ test-layout-free-zone/include/asm-x86_64/page.h
@@ -123,8 +123,6 @@ typedef struct { unsigned long pgprot; }
  #define __boot_va(x)		__va(x)
  #define __boot_pa(x)		__pa(x)
  #ifdef CONFIG_FLATMEM
-#define pfn_to_page(pfn)	(mem_map + (pfn))
-#define page_to_pfn(page)	((unsigned long)((page) - mem_map))
  #define pfn_valid(pfn)		((pfn) < end_pfn)
  #endif

Index: test-layout-free-zone/arch/x86_64/Kconfig
===================================================================
--- test-layout-free-zone.orig/arch/x86_64/Kconfig
+++ test-layout-free-zone/arch/x86_64/Kconfig
@@ -321,6 +321,10 @@ config HAVE_ARCH_EARLY_PFN_TO_NID
  	def_bool y
  	depends on NUMA

+config DONT_INLINE_PFN_TO_PAGE
+	def_bool y
+	depends on DISCONTIGMEM
+
  config NR_CPUS
  	int "Maximum number of CPUs (2-256)"
  	range 2 256


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-02-08  5:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-08  5:46 [PATCH] unify pfn_to_page take 2 [3/25] x86_64 funcs KAMEZAWA Hiroyuki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox