]> git.baikalelectronics.ru Git - kernel.git/commit
debugobjects: delay free of internal objects
authorThomas Gleixner <tglx@linutronix.de>
Mon, 16 Mar 2009 09:04:53 +0000 (10:04 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 17 Mar 2009 11:28:30 +0000 (12:28 +0100)
commitc5e05ad5989e61dc414ee592ce5abdd962d8592e
tree7fd379d4a3d23e055f19be2d447de2ea64ecd069
parentfef9001056949f376e868591eace0c046f480d18
debugobjects: delay free of internal objects

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: Thomas Gleixner <tglx@linutronix.de>
LKML-Reference: <200903162049.58058.nickpiggin@yahoo.com.au>
lib/debugobjects.c