Optimize section_to_node_table so that it fits in a cacheline We change the type of the elements in the section to node table to u8 if we have less than 256 nodes in the system. That way we can have up to 128 sections in one cacheline which is all that is necessary for some 32 bit NUMA platforms like NUMAQ to keep the array in a single cacheline. Signed-off-by: Christoph Lameter Index: linux-2.6.18-rc6-mm2/mm/sparse.c =================================================================== --- linux-2.6.18-rc6-mm2.orig/mm/sparse.c 2006-09-15 12:43:12.000000000 -0500 +++ linux-2.6.18-rc6-mm2/mm/sparse.c 2006-09-15 12:50:20.857430106 -0500 @@ -30,7 +30,11 @@ EXPORT_SYMBOL(mem_section); * do a lookup in the section_to_node_table in order to find which * node the page belongs to. */ -static int section_to_node_table[NR_MEM_SECTIONS]; +#if MAX_NUMNODES <= 256 +static u8 section_to_node_table[NR_MEM_SECTIONS] __cacheline_aligned; +#else +static u16 section_to_node_table[NR_MEM_SECTIONS] __cacheline_aligned; +#endif extern unsigned long page_to_nid(struct page *page) {