Re: [PATCH] remove zone_mem_map

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christoph Lameter wrote:
On Wed, 22 Feb 2006, KAMEZAWA Hiroyuki wrote:

This patch removes zone_mem_map.

Note that IA64 does not seem to depend on zone_mem_map...

Oh, yes. ia64 doesn't includes asm-generic/memory_model.h when DISCONTIGMEM.

Index: test/include/asm-generic/memory_model.h
===================================================================
--- test.orig/include/asm-generic/memory_model.h
+++ test/include/asm-generic/memory_model.h
@@ -47,9 +47,9 @@ extern unsigned long page_to_pfn(struct

 #define page_to_pfn(pg)			\
 ({	struct page *__pg = (pg);		\
-	struct zone *__zone = page_zone(__pg);	\
-	(unsigned long)(__pg - __zone->zone_mem_map) +	\
-	 __zone->zone_start_pfn;			\
+	struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg));	\
+	(unsigned long)(__pg - __pgdat->node_mem_map) +	\
+	 __pgdat->node_start_pfn;			\
 })

NODE_DATA is an arch specific lookup, If it always is a table lookup
then the performance will be comparable to page_zone because that also involves one table lookup.

There are several types of NODE_DATA definitions.
1. #define NODE_DATA(node)	(&node_data[node]) alpha,arm,
2. #define NODE_DATA(node)      (node_data[node]) i386,powerpc,x86_64,m32r
3. #define NODE_DATA(node)	(&node_data[node]->pgdat) parisc,mips
4. #define NODE_DATA(node)	(per-cpu-page has node_data[nid] pointer array) ia64

BTW, ia64 looks very special. Does it make sensible performance gain ?

-- Kame

-
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]
  Powered by Linux