]> err.no Git - linux-2.6/commitdiff
[PATCH] Add node to zone for the NUMA case
authorChristoph Lameter <clameter@sgi.com>
Wed, 27 Sep 2006 08:50:08 +0000 (01:50 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 27 Sep 2006 15:26:13 +0000 (08:26 -0700)
Add the node in order to optimize zone_to_nid.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Acked-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/mm.h
include/linux/mmzone.h
mm/page_alloc.c

index 7477fb59c4f27eb9c495d89e8c31b2e70b7b0b7c..8e433bbc6e7ed55784b09724a47250aea2ab7938 100644 (file)
@@ -446,7 +446,11 @@ static inline struct zone *page_zone(struct page *page)
 
 static inline unsigned long zone_to_nid(struct zone *zone)
 {
-       return zone->zone_pgdat->node_id;
+#ifdef CONFIG_NUMA
+       return zone->node;
+#else
+       return 0;
+#endif
 }
 
 static inline unsigned long page_to_nid(struct page *page)
index 562cf7a8f3ee3cce0c1a5c6d3aba2cb2c86072d8..59855b8718a0a4b993a39cb825034ad081dd09cd 100644 (file)
@@ -168,6 +168,7 @@ struct zone {
        unsigned long           lowmem_reserve[MAX_NR_ZONES];
 
 #ifdef CONFIG_NUMA
+       int node;
        /*
         * zone reclaim becomes active if more unmapped pages exist.
         */
index 4c76188b168178eec050d2f06c662af18c4e301a..d0432e44f77d9e29a27a82362e7258f0b34c2f38 100644 (file)
@@ -2405,6 +2405,7 @@ static void __meminit free_area_init_core(struct pglist_data *pgdat,
                zone->spanned_pages = size;
                zone->present_pages = realsize;
 #ifdef CONFIG_NUMA
+               zone->node = nid;
                zone->min_unmapped_pages = (realsize*sysctl_min_unmapped_ratio)
                                                / 100;
                zone->min_slab_pages = (realsize * sysctl_min_slab_ratio) / 100;