Commit f8f74d37 authored by Nick Piggin's avatar Nick Piggin Committed by Pekka Enberg

slqb: irq section fix

flush_free_list can be called with interrupts enabled, from
kmem_cache_destroy. Fix this.
Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
parent caf83ba6
......@@ -1087,7 +1087,6 @@ static void slab_free_to_remote(struct kmem_cache *s, struct slqb_page *page,
*/
static void flush_free_list(struct kmem_cache *s, struct kmem_cache_list *l)
{
struct kmem_cache_cpu *c;
void **head;
int nr;
......@@ -1100,8 +1099,6 @@ static void flush_free_list(struct kmem_cache *s, struct kmem_cache_list *l)
slqb_stat_inc(l, FLUSH_FREE_LIST);
slqb_stat_add(l, FLUSH_FREE_LIST_OBJECTS, nr);
c = get_cpu_slab(s, smp_processor_id());
l->freelist.nr -= nr;
head = l->freelist.head;
......@@ -1116,6 +1113,10 @@ static void flush_free_list(struct kmem_cache *s, struct kmem_cache_list *l)
#ifdef CONFIG_SMP
if (page->list != l) {
struct kmem_cache_cpu *c;
c = get_cpu_slab(s, smp_processor_id());
slab_free_to_remote(s, page, object, c);
slqb_stat_inc(l, FLUSH_FREE_LIST_REMOTE);
} else
......@@ -2251,6 +2252,7 @@ void kmem_cache_destroy(struct kmem_cache *s)
down_write(&slqb_lock);
list_del(&s->list);
local_irq_disable();
#ifdef CONFIG_SMP
for_each_online_cpu(cpu) {
struct kmem_cache_cpu *c = get_cpu_slab(s, cpu);
......@@ -2297,6 +2299,7 @@ void kmem_cache_destroy(struct kmem_cache *s)
free_kmem_cache_nodes(s);
#endif
local_irq_enable();
sysfs_slab_remove(s);
up_write(&slqb_lock);
......
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