]> git.karo-electronics.de Git - karo-tx-linux.git/commit
slab: delete cache from list after __kmem_cache_shutdown succeeds
authorVladimir Davydov <vdavydov@parallels.com>
Thu, 22 May 2014 00:43:17 +0000 (10:43 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 22 May 2014 00:43:17 +0000 (10:43 +1000)
commit63ef2a405f708f7a6b1eeb45a6806264d25818fc
tree3f9e4dc7e5ee7bcb0710d1094e920caedcb10989
parent0dfbc01b5c02b6a9b58a40541bfd95e6e670c592
slab: delete cache from list after __kmem_cache_shutdown succeeds

Currently, on kmem_cache_destroy we delete the cache from the slab_list
before __kmem_cache_shutdown, inserting it back to the list on failure.
Initially, this was done, because we could release the slab_mutex in
__kmem_cache_shutdown to delete sysfs slub entry, but since commit
41a212859a4d ("slub: use sysfs'es release mechanism for kmem_cache") we
remove sysfs entry later in kmem_cache_destroy after dropping the
slab_mutex, so that no implementation of __kmem_cache_shutdown can ever
release the lock.  Therefore we can simplify the code a bit by moving
list_del after __kmem_cache_shutdown.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/slab_common.c