Skip to contentSkip to conversation

slab-delete-cache-from-list-after-__kmem_cache_shutdown-succeeds.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jun 5, 2014

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

Subject: [merged] slab-delete-cache-from-list-after-__kmem_cache_shutdown-succeeds.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Thu, 05 Jun 2014 12:52:15 -0700

The patch titled
Subject: slab: delete cache from list after __kmem_cache_shutdown succeeds
has been removed from the -mm tree. Its filename was
slab-delete-cache-from-list-after-__kmem_cache_shutdown-succeeds.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Vladimir Davydov <[email protected]>
Subject: 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.

---

 mm/slab_common.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/slab_common.c renamed from mm/slab_common.c~slab-delete-cache-from-list-after-__kmem_cache_shutdown-succeeds +2 -2
diff -puN mm/slab_common.c~slab-delete-cache-from-list-after-__kmem_cache_shutdown-succeeds mm/slab_common.c
@@ -346,15 +346,15 @@ void kmem_cache_destroy(struct kmem_cach
 	if (memcg_cleanup_cache_params(s) != 0)
 		goto out_unlock;
 
-	list_del(&s->list);
 	if (__kmem_cache_shutdown(s) != 0) {
-		list_add(&s->list, &slab_caches);
 		printk(KERN_ERR "kmem_cache_destroy %s: "
 		       "Slab cache still has objects\n", s->name);
 		dump_stack();
 		goto out_unlock;
 	}
 
+	list_del(&s->list);
+
 	mutex_unlock(&slab_mutex);
 	if (s->flags & SLAB_DESTROY_BY_RCU)
 		rcu_barrier();

_

Patches currently in -mm which might be from [email protected] are

origin.patch
linux-next.patch