slub: free slabs without holding locks
authorChristoph Lameter <cl@linux.com>
Tue, 9 Aug 2011 21:12:22 +0000 (16:12 -0500)
committerPekka Enberg <penberg@kernel.org>
Fri, 19 Aug 2011 16:34:25 +0000 (19:34 +0300)
commit69cb8e6b7c2982e015d2b35a34ac2674c79e801c
tree37905e4cec71f96f2008e9d13c92cf0b976b3390
parent93ee7a9340d64f20295aacc3fb6a22b759323280
slub: free slabs without holding locks

There are two situations in which slub holds a lock while releasing
pages:

A. During kmem_cache_shrink()
B. During kmem_cache_close()

For A build a list while holding the lock and then release the pages
later. In case of B we are the last remaining user of the slab so
there is no need to take the listlock.

After this patch all calls to the page allocator to free pages are
done without holding any spinlocks. kmem_cache_destroy() will still
hold the slub_lock semaphore.

Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
mm/slub.c