From: Prakash Surya Date: Fri, 27 Apr 2012 19:43:49 +0000 (-0700) Subject: Ignore slab cache age and delay in direct reclaim X-Git-Tag: zfs-0.8.0-rc1~152^2~392 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c0e0fc14e3e65e519849dd9fbfb94a6c79d0d149;p=zfs Ignore slab cache age and delay in direct reclaim When memory pressure triggers direct memory reclaim, a slabs age and delay should not prevent it from being freed. This patch ensures these values are ignored, allowing an empty slab to be freed in this code path no matter the value of its age and delay. This prevents needless scanning of the partial slabs and has been observed to significantly reduce the total cpu usage. In addition, it should allow for snappier reclaim under memory pressure. Signed-off-by: Prakash Surya Signed-off-by: Brian Behlendorf Closes #102 --- diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c index eadf1cb17..361030b18 100644 --- a/module/spl/spl-kmem.c +++ b/module/spl/spl-kmem.c @@ -1916,7 +1916,8 @@ spl_kmem_cache_reap_now(spl_kmem_cache_t *skc, int count) if (skc->skc_reclaim) skc->skc_reclaim(skc->skc_private); - spl_slab_reclaim(skc, count, 0); + /* Reclaim from the cache, ignoring it's age and delay. */ + spl_slab_reclaim(skc, count, 1); clear_bit(KMC_BIT_REAPING, &skc->skc_flags); atomic_dec(&skc->skc_ref);