• Thomas Gleixner's avatar
    debugobjects: delay free of internal objects · 337fff8b
    Thomas Gleixner authored
    Impact: avoid recursive kfree calls, less slab activity on heavy load
    
    debugobjects checks on kfree whether tracked objects are freed. When a
    tracked object is freed debugobjects frees the internal reference
    object as well. The debug object slab cache is marked to not recurse
    into debugobjects when a slab objects is freed, but the recursive call
    can be problematic versus locking in the memory allocator.
    
    Defer the freeing of debug slab objects via schedule_work. The reasons
    not to use RCU are:
    
    1) rcu makes the data structure larger
    2) there is no real need for rcu as nothing references the obj after
       we freed it
    3) under heavy load it is easier to reuse the to be freed objects instead
       of allocating new objects from the slab. This lowered the slab activity
       significantly in a heavy load networking test where lots of timers are
       created/destroyed. The workqueue based delayed free allows us just to
       put the to be freed objects back into the object pool and reuse them
       right away.
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    LKML-Reference: <200903162049.58058.nickpiggin@yahoo.com.au>
    337fff8b
debugobjects.c 23.8 KB