From 2e0a64538da4494843b9643a6fca9b18028bcb9a Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Sat, 25 Mar 2006 03:06:45 -0800 Subject: [PATCH] --- yaml --- r: 23509 b: refs/heads/master c: e00946fe2351307eb3eda7a3343530f6d2d1af2e h: refs/heads/master i: 23507: 63b05fbb23711ad42e69d771f9b4c6f35a9acf46 v: v3 --- [refs] | 2 +- trunk/mm/slab.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index a776a8454c5f..1497d2abde2a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3ded175a4b7a4548f3358dcf5f3ad65f63cdb4ed +refs/heads/master: e00946fe2351307eb3eda7a3343530f6d2d1af2e diff --git a/trunk/mm/slab.c b/trunk/mm/slab.c index dee857a8680b..351aa6c587f7 100644 --- a/trunk/mm/slab.c +++ b/trunk/mm/slab.c @@ -971,6 +971,13 @@ static void __drain_alien_cache(struct kmem_cache *cachep, if (ac->avail) { spin_lock(&rl3->list_lock); + /* + * Stuff objects into the remote nodes shared array first. + * That way we could avoid the overhead of putting the objects + * into the free lists and getting them back later. + */ + transfer_objects(rl3->shared, ac, ac->limit); + free_block(cachep, ac->entry, ac->avail, node); ac->avail = 0; spin_unlock(&rl3->list_lock); @@ -986,8 +993,8 @@ static void reap_alien(struct kmem_cache *cachep, struct kmem_list3 *l3) if (l3->alien) { struct array_cache *ac = l3->alien[node]; - if (ac && ac->avail) { - spin_lock_irq(&ac->lock); + + if (ac && ac->avail && spin_trylock_irq(&ac->lock)) { __drain_alien_cache(cachep, ac, node); spin_unlock_irq(&ac->lock); }