Commit 3dc329ba authored by Linus Torvalds's avatar Linus Torvalds

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()
parents 03d3602a 210ed9de
...@@ -168,6 +168,7 @@ void kmem_cache_destroy(struct kmem_cache *s) ...@@ -168,6 +168,7 @@ void kmem_cache_destroy(struct kmem_cache *s)
list_del(&s->list); list_del(&s->list);
if (!__kmem_cache_shutdown(s)) { if (!__kmem_cache_shutdown(s)) {
mutex_unlock(&slab_mutex);
if (s->flags & SLAB_DESTROY_BY_RCU) if (s->flags & SLAB_DESTROY_BY_RCU)
rcu_barrier(); rcu_barrier();
...@@ -175,12 +176,14 @@ void kmem_cache_destroy(struct kmem_cache *s) ...@@ -175,12 +176,14 @@ void kmem_cache_destroy(struct kmem_cache *s)
kmem_cache_free(kmem_cache, s); kmem_cache_free(kmem_cache, s);
} else { } else {
list_add(&s->list, &slab_caches); list_add(&s->list, &slab_caches);
mutex_unlock(&slab_mutex);
printk(KERN_ERR "kmem_cache_destroy %s: Slab cache still has objects\n", printk(KERN_ERR "kmem_cache_destroy %s: Slab cache still has objects\n",
s->name); s->name);
dump_stack(); dump_stack();
} }
} else {
mutex_unlock(&slab_mutex);
} }
mutex_unlock(&slab_mutex);
put_online_cpus(); put_online_cpus();
} }
EXPORT_SYMBOL(kmem_cache_destroy); EXPORT_SYMBOL(kmem_cache_destroy);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment