• Joonsoo Kim's avatar
    mm/slab: support slab merge · 12220dea
    Joonsoo Kim authored
    Slab merge is good feature to reduce fragmentation.  If new creating slab
    have similar size and property with exsitent slab, this feature reuse it
    rather than creating new one.  As a result, objects are packed into fewer
    slabs so that fragmentation is reduced.
    
    Below is result of my testing.
    
    * After boot, sleep 20; cat /proc/meminfo | grep Slab
    
    <Before>
    Slab: 25136 kB
    
    <After>
    Slab: 24364 kB
    
    We can save 3% memory used by slab.
    
    For supporting this feature in SLAB, we need to implement SLAB specific
    kmem_cache_flag() and __kmem_cache_alias(), because SLUB implements some
    SLUB specific processing related to debug flag and object size change on
    these functions.
    Signed-off-by: default avatarJoonsoo Kim <iamjoonsoo.kim@lge.com>
    Cc: Christoph Lameter <cl@linux.com>
    Cc: Pekka Enberg <penberg@kernel.org>
    Cc: David Rientjes <rientjes@google.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    12220dea
slab.c 109 KB