@@ -759,8 +759,10 @@ static int __cache_free_alien(struct kmem_cache *cachep, void *objp,
n = get_node(cachep, node);
STATS_INC_NODEFREES(cachep);
+ spin_lock(&n->list_lock);
if (n->alien && n->alien[page_node]) {
alien = n->alien[page_node];
+ spin_unlock(&n->list_lock);
ac = &alien->ac;
spin_lock(&alien->lock);
if (unlikely(ac->avail == ac->limit)) {
@@ -769,14 +771,15 @@ static int __cache_free_alien(struct kmem_cache *cachep, void *objp,
}
ac->entry[ac->avail++] = objp;
spin_unlock(&alien->lock);
- slabs_destroy(cachep, &list);
} else {
+ spin_unlock(&n->list_lock);
n = get_node(cachep, page_node);
spin_lock(&n->list_lock);
free_block(cachep, &objp, 1, page_node, &list);
spin_unlock(&n->list_lock);
- slabs_destroy(cachep, &list);
}
+
+ slabs_destroy(cachep, &list);
return 1;
}