• Andrew Morton's avatar
    [PATCH] reduce function inlining in slab.c · f875aa02
    Andrew Morton authored
    From: Manfred Spraul <manfred@colorfullife.com>
    
    slab.c contains too many inline functions:
    
    - some functions that are not performance critical were inlined.  Waste
      of text size.
    
    - The debug code relies on __builtin_return_address(0) to keep track of
      the callers.  According to rmk, gcc didn't inline some functions as
      expected and that resulted in useless debug output.  This was probably
      caused by the large debug-only inline functions.
    
    The attached patche removes most inline functions:
    
    - the empty on release/huge on debug inline functions were replaced with
      empty macros on release/normal functions on debug.
    
    - spurious inline statements were removed.
    
    The code is down to 6 inline functions: three one-liners for struct
    abstractions, one for a might_sleep_if test and two for the performance
    critical __cache_alloc / __cache_free functions.
    
    Note: If an embedded arch wants to save a few bytes by uninlining
    __cache_{free,alloc}: The right way to do that is to fold the functions
    into kmem_cache_xy and then replace kmalloc with
    kmem_cache_alloc(kmem_find_general_cachep(),).
    
    Signed-Off: Manfred Spraul <manfred@colorfullife.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    f875aa02
slab.c 80.1 KB