• C
    SLUB: minimum alignment fixes · 4b356be0
    Christoph Lameter 提交于
    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: NChristoph Lameter <clameter@sgi.com>
    Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
    Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
    4b356be0
slub.c 86.8 KB