diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-12 09:19:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-12 09:19:28 -0400 |
commit | 3dc329baa2ed1740036183041cefaf8ceb714038 (patch) | |
tree | bddec4d560f8f9775d2ad5bca484da9d0f11bbb6 | |
parent | 03d3602a833715f83ea53b9feb078b9c4c5f6c1a (diff) | |
parent | 210ed9defffca13b909f040d7338d8062e5594a3 (diff) |
Merge branch 'slab/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/linux
Pull SLAB fix from Pekka Enberg:
"This contains a lockdep false positive fix from Jiri Kosina I missed
from the previous pull request."
* 'slab/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/linux:
mm, slab: release slab_mutex earlier in kmem_cache_destroy()
-rw-r--r-- | mm/slab_common.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c index 9c217255ac4..069a24e6440 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c | |||
@@ -168,6 +168,7 @@ void kmem_cache_destroy(struct kmem_cache *s) | |||
168 | list_del(&s->list); | 168 | list_del(&s->list); |
169 | 169 | ||
170 | if (!__kmem_cache_shutdown(s)) { | 170 | if (!__kmem_cache_shutdown(s)) { |
171 | mutex_unlock(&slab_mutex); | ||
171 | if (s->flags & SLAB_DESTROY_BY_RCU) | 172 | if (s->flags & SLAB_DESTROY_BY_RCU) |
172 | rcu_barrier(); | 173 | rcu_barrier(); |
173 | 174 | ||
@@ -175,12 +176,14 @@ void kmem_cache_destroy(struct kmem_cache *s) | |||
175 | kmem_cache_free(kmem_cache, s); | 176 | kmem_cache_free(kmem_cache, s); |
176 | } else { | 177 | } else { |
177 | list_add(&s->list, &slab_caches); | 178 | list_add(&s->list, &slab_caches); |
179 | mutex_unlock(&slab_mutex); | ||
178 | printk(KERN_ERR "kmem_cache_destroy %s: Slab cache still has objects\n", | 180 | printk(KERN_ERR "kmem_cache_destroy %s: Slab cache still has objects\n", |
179 | s->name); | 181 | s->name); |
180 | dump_stack(); | 182 | dump_stack(); |
181 | } | 183 | } |
184 | } else { | ||
185 | mutex_unlock(&slab_mutex); | ||
182 | } | 186 | } |
183 | mutex_unlock(&slab_mutex); | ||
184 | put_online_cpus(); | 187 | put_online_cpus(); |
185 | } | 188 | } |
186 | EXPORT_SYMBOL(kmem_cache_destroy); | 189 | EXPORT_SYMBOL(kmem_cache_destroy); |