summaryrefslogtreecommitdiffstats
path: root/module/spl/spl-kmem.c
diff options
context:
space:
mode:
authorPrakash Surya <[email protected]>2012-04-27 12:43:49 -0700
committerBrian Behlendorf <[email protected]>2012-05-07 11:50:04 -0700
commitc0e0fc14e3e65e519849dd9fbfb94a6c79d0d149 (patch)
tree9cd11c821b31173e2b816045165774ef7630bfa4 /module/spl/spl-kmem.c
parentcef7605c342a87eb108b6eac919cae737c08a230 (diff)
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 <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #102
Diffstat (limited to 'module/spl/spl-kmem.c')
-rw-r--r--module/spl/spl-kmem.c3
1 files changed, 2 insertions, 1 deletions
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);