From f6d79ab728db6e949a7b37b8c1a4647990d7e487 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Tue, 18 Dec 2012 14:23:13 -0800 Subject: [PATCH] --- yaml --- r: 347032 b: refs/heads/master c: 5413dfba88d6f6090c8cdf181ab9172d24752f8f h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/mm/slub.c | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index b305a1e14139..8bf2632d8982 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ebe945c27628fca03723582eba138acc2e2f3d15 +refs/heads/master: 5413dfba88d6f6090c8cdf181ab9172d24752f8f diff --git a/trunk/mm/slub.c b/trunk/mm/slub.c index efe2cffc29b0..ba2ca53f6c3a 100644 --- a/trunk/mm/slub.c +++ b/trunk/mm/slub.c @@ -3153,8 +3153,19 @@ int __kmem_cache_shutdown(struct kmem_cache *s) { int rc = kmem_cache_close(s); - if (!rc) + if (!rc) { + /* + * We do the same lock strategy around sysfs_slab_add, see + * __kmem_cache_create. Because this is pretty much the last + * operation we do and the lock will be released shortly after + * that in slab_common.c, we could just move sysfs_slab_remove + * to a later point in common code. We should do that when we + * have a common sysfs framework for all allocators. + */ + mutex_unlock(&slab_mutex); sysfs_slab_remove(s); + mutex_lock(&slab_mutex); + } return rc; }