aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2006-09-27 04:50:08 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-27 11:26:13 -0400
commitd5f541ed6e31518508c688912e7464facf253c87 (patch)
tree028d296306e247ca32ec5db398d365dcd70d26b7
parent765c4507af71c39aba21006bbd3ec809fe9714ff (diff)
[PATCH] Add node to zone for the NUMA case
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>
-rw-r--r--include/linux/mm.h6
-rw-r--r--include/linux/mmzone.h1
-rw-r--r--mm/page_alloc.c1
3 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 7477fb59c4f2..8e433bbc6e7e 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -446,7 +446,11 @@ static inline struct zone *page_zone(struct page *page)
446 446
447static inline unsigned long zone_to_nid(struct zone *zone) 447static inline unsigned long zone_to_nid(struct zone *zone)
448{ 448{
449 return zone->zone_pgdat->node_id; 449#ifdef CONFIG_NUMA
450 return zone->node;
451#else
452 return 0;
453#endif
450} 454}
451 455
452static inline unsigned long page_to_nid(struct page *page) 456static inline unsigned long page_to_nid(struct page *page)
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 562cf7a8f3ee..59855b8718a0 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -168,6 +168,7 @@ struct zone {
168 unsigned long lowmem_reserve[MAX_NR_ZONES]; 168 unsigned long lowmem_reserve[MAX_NR_ZONES];
169 169
170#ifdef CONFIG_NUMA 170#ifdef CONFIG_NUMA
171 int node;
171 /* 172 /*
172 * zone reclaim becomes active if more unmapped pages exist. 173 * zone reclaim becomes active if more unmapped pages exist.
173 */ 174 */
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 4c76188b1681..d0432e44f77d 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2405,6 +2405,7 @@ static void __meminit free_area_init_core(struct pglist_data *pgdat,
2405 zone->spanned_pages = size; 2405 zone->spanned_pages = size;
2406 zone->present_pages = realsize; 2406 zone->present_pages = realsize;
2407#ifdef CONFIG_NUMA 2407#ifdef CONFIG_NUMA
2408 zone->node = nid;
2408 zone->min_unmapped_pages = (realsize*sysctl_min_unmapped_ratio) 2409 zone->min_unmapped_pages = (realsize*sysctl_min_unmapped_ratio)
2409 / 100; 2410 / 100;
2410 zone->min_slab_pages = (realsize * sysctl_min_slab_ratio) / 100; 2411 zone->min_slab_pages = (realsize * sysctl_min_slab_ratio) / 100;