• Matt Mackall's avatar
    slob: reduce list scanning · d6269543
    Matt Mackall authored
    The version of SLOB in -mm always scans its free list from the beginning,
    which results in small allocations and free segments clustering at the
    beginning of the list over time.  This causes the average search to scan
    over a large stretch at the beginning on each allocation.
    
    By starting each page search where the last one left off, we evenly
    distribute the allocations and greatly shorten the average search.
    
    Without this patch, kernel compiles on a 1.5G machine take a large amount
    of system time for list scanning.  With this patch, compiles are within a
    few seconds of performance of a SLAB kernel with no notable change in
    system time.
    Signed-off-by: default avatarMatt Mackall <mpm@selenic.com>
    Cc: Christoph Lameter <clameter@sgi.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    d6269543
slob.c 14.9 KB