Replace some uses of free_block_lock with drain_array(). free_block_lock is sometimes used to drain an array. Then why not call drain_array directly and specify the force parameter? Signed-off-by: Christoph Lameter Index: linux-2.6.16-rc5-mm2/mm/slab.c =================================================================== --- linux-2.6.16-rc5-mm2.orig/mm/slab.c 2006-03-03 17:35:36.000000000 -0800 +++ linux-2.6.16-rc5-mm2/mm/slab.c 2006-03-03 17:49:25.000000000 -0800 @@ -952,15 +952,14 @@ static void free_alien_cache(struct arra kfree(ac_ptr); } +static void drain_array(struct kmem_cache *cachep, + struct kmem_list3 *l3, struct array_cache *ac, + int force, int node); + static void __drain_alien_cache(struct kmem_cache *cachep, struct array_cache *ac, int node) { - struct kmem_list3 *rl3 = cachep->nodelists[node]; - - if (ac->avail) { - free_block_lock(cachep, rl3, ac->entry, ac->avail); - ac->avail=0; - } + drain_array(cachep, cachep->nodelists[node], ac, 1, node); } /* @@ -2140,14 +2139,10 @@ static void drain_array(struct kmem_cach static void do_drain(void *arg) { struct kmem_cache *cachep = arg; - struct array_cache *ac; - int node = numa_node_id(); check_irq_off(); - ac = cpu_cache_get(cachep); - free_block_lock(cachep, cachep->nodelists[node], - ac->entry, ac->avail); - ac->avail = 0; + drain_array(cachep, cachep->nodelists[numa_node_id()], + cpu_cache_get(cachep), 1, numa_node_id()); } static void drain_cpu_caches(struct kmem_cache *cachep) @@ -3491,19 +3486,7 @@ static int do_tune_cpucache(struct kmem_ if (!ccold) continue; - /* - * Local interrupts must be disabled only for - * this node because the list_lock may be obtained - * in an interrupt context. - */ - if (node == numa_node_id()) - local_irq_disable(); - - free_block_lock(cachep, cachep->nodelists[node], - ccold->entry, ccold->avail); - - if (node == numa_node_id()) - local_irq_enable(); + drain_array(cachep, cachep->nodelists[node], ccold, 1, node); kfree(ccold); }