• Anton Blanchard's avatar
    [PATCH] remove cacheline alignment from inode slabs · 597648bb
    Anton Blanchard authored
    Most of the inode slabs are cacheline aligned.  This can waste a fair
    amount of memory, especially on architectures with large cacheline sizes
    (eg 128 bytes).
    
    Alignment has a few advantages.  It prevents 2 cpus from accessing 2 data
    structures in the same cacheline.  Since struct inodes are well over a
    cacheline and there are so many of them, there is little chance we will hit
    this problem if we remove the alignment.  
    
    Alignment also ensures the maximum amount of the data structure is in the
    same cacheline (instead of straddling 2 for example).  The large size of
    struct inode reduces this advantage.
    
    With this patch the inode_cache slab goes from 640 bytes to 544 bytes, and
    the number that fits in a 4kB slab goes from 6 to 7 on ppc64.  A number of
    other inode slabs also see improvements.
    Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    597648bb
super.c 36.3 KB