From: Christoph Lameter There are many places where we need to determine the node of a zone. Currently we use a difficult to read sequence of pointer dereferencing. Put that into an inline function and use throughout VM. Maybe we can find a way to optimize the lookup in the future. Signed-off-by: Christoph Lameter Signed-off-by: Andrew Morton --- mm/swap_prefetch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff -puN mm/swap_prefetch.c~numa-add-zone_to_nid-function-swap_prefetch mm/swap_prefetch.c --- a/mm/swap_prefetch.c~numa-add-zone_to_nid-function-swap_prefetch +++ a/mm/swap_prefetch.c @@ -276,7 +276,7 @@ static void examine_free_limits(void) if (!populated_zone(z)) continue; - ns = &sp_stat.node[z->zone_pgdat->node_id]; + ns = &sp_stat.node[zone_to_nid(z)]; idx = zone_idx(z); ns->lowfree[idx] = z->pages_high * 3; ns->highfree[idx] = ns->lowfree[idx] + z->pages_high; @@ -334,7 +334,7 @@ static int prefetch_suitable(void) if (!populated_zone(z)) continue; - node = z->zone_pgdat->node_id; + node = zone_to_nid(z); ns = &sp_stat.node[node]; idx = zone_idx(z); @@ -558,7 +558,7 @@ void __init prepare_swap_prefetch(void) if (!present) continue; - ns = &sp_stat.node[zone->zone_pgdat->node_id]; + ns = &sp_stat.node[zone_to_nid(zone)]; ns->prefetch_watermark += present / 3 * 2; idx = zone_idx(zone); ns->pointfree[idx] = &ns->highfree[idx]; _