• Christoph Lameter's avatar
    SLUB: minimum alignment fixes · 4b356be0
    Christoph Lameter authored
    If ARCH_KMALLOC_MINALIGN is set to a value greater than 8 (SLUBs smallest
    kmalloc cache) then SLUB may generate duplicate slabs in sysfs (yes again)
    because the object size is padded to reach ARCH_KMALLOC_MINALIGN.  Thus the
    size of the small slabs is all the same.
    
    No arch sets ARCH_KMALLOC_MINALIGN larger than 8 though except mips which
    for some reason wants a 128 byte alignment.
    
    This patch increases the size of the smallest cache if
    ARCH_KMALLOC_MINALIGN is greater than 8.  In that case more and more of the
    smallest caches are disabled.
    
    If we do that then the count of the active general caches that is displayed
    on boot is not correct anymore since we may skip elements of the kmalloc
    array.  So count them separately.
    
    This approach was tested by Havard yesterday.
    Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
    Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    4b356be0
slub.c 86.8 KB