Currently we keep track of a pages node & zone in the top 8 bits (on 32-bit arches, 10 bits on 64-bit arches) of page->flags. We typically do: node_num * MAX_NR_ZONES + zone_num = 'nodezone'. It's non-trivial to break this 'nodezone' back into node and zone numbers. This patch modifies the way we compute the index to be: (node_num << ZONE_SHIFT) | zone_num. This makes it trivial to recover either the node or zone number with a simple bitshift. There are many places in the kernel where we do things like: page_zone(page)->zone_pgdat->node_id to determine the node a page belongs to. With this patch we save several pointer dereferences, and it boils down to shifting some bits. Comments/criticism requested. [mcd@arrakis current]$ diffstat nodezone.patch include/linux/mm.h | 21 ++++++++++++++++----- include/linux/mmzone.h | 15 ++++++++++++--- mm/page_alloc.c | 6 +++--- 3 files changed, 31 insertions(+), 11 deletions(-) Cheers! -Matt