mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 08:31:13 +00:00
[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>
This commit is contained in:
parent
765c4507af
commit
d5f541ed6e
3 changed files with 7 additions and 1 deletions
|
@ -446,7 +446,11 @@ static inline struct zone *page_zone(struct page *page)
|
||||||
|
|
||||||
static inline unsigned long zone_to_nid(struct zone *zone)
|
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)
|
static inline unsigned long page_to_nid(struct page *page)
|
||||||
|
|
|
@ -168,6 +168,7 @@ struct zone {
|
||||||
unsigned long lowmem_reserve[MAX_NR_ZONES];
|
unsigned long lowmem_reserve[MAX_NR_ZONES];
|
||||||
|
|
||||||
#ifdef CONFIG_NUMA
|
#ifdef CONFIG_NUMA
|
||||||
|
int node;
|
||||||
/*
|
/*
|
||||||
* zone reclaim becomes active if more unmapped pages exist.
|
* zone reclaim becomes active if more unmapped pages exist.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2405,6 +2405,7 @@ static void __meminit free_area_init_core(struct pglist_data *pgdat,
|
||||||
zone->spanned_pages = size;
|
zone->spanned_pages = size;
|
||||||
zone->present_pages = realsize;
|
zone->present_pages = realsize;
|
||||||
#ifdef CONFIG_NUMA
|
#ifdef CONFIG_NUMA
|
||||||
|
zone->node = nid;
|
||||||
zone->min_unmapped_pages = (realsize*sysctl_min_unmapped_ratio)
|
zone->min_unmapped_pages = (realsize*sysctl_min_unmapped_ratio)
|
||||||
/ 100;
|
/ 100;
|
||||||
zone->min_slab_pages = (realsize * sysctl_min_slab_ratio) / 100;
|
zone->min_slab_pages = (realsize * sysctl_min_slab_ratio) / 100;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue