• Eric Dumazet's avatar
    [PATCH] x86_64: Optimize NUMA node hash function · 529a3404
    Eric Dumazet authored
    Compute the highest possible value for memnode_shift, in order to reduce
    footprint of memnodemap[] to the minimum, thus making all users
    (phys_to_nid(), kfree()), more cache friendly.
    
    Before the patch :
    
     Node 0 MemBase 0000000000000000 Limit 00000001ffffffff
     Node 1 MemBase 0000000200000000 Limit 00000003ffffffff
     Using 23 for the hash shift. Max adder is 3ffffffff
    
    After the patch :
    
     Node 0 MemBase 0000000000000000 Limit 00000001ffffffff
     Node 1 MemBase 0000000200000000 Limit 00000003ffffffff
     Using 33 for the hash shift.
    
    In this case, only 2 bytes of memnodemap[] are used, instead of 2048
    Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
    Signed-off-by: default avatarAndi Kleen <ak@suse.de>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    529a3404
numa.c 8.13 KB