]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitf42789e1b0d19572fdd4dbe5b6f2c28da1dcbbce
tree37905e4cec71f96f2008e9d13c92cf0b976b3390
parent0ce4436a35d4d3c43b130212cebb130e5f30ad5d
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