From 2e91c2fb1a47f98c2dc06725c284db16d852a618 Mon Sep 17 00:00:00 2001 From: Debabrata Banerjee Date: Wed, 15 Mar 2017 18:50:32 -0400 Subject: [PATCH] Do not stop kernel shrinker on lock contention Lock contention, by itself, shouldn't indicate a stop condition to the kernel's slab shrinker. Doing so can cause stalls when the kernel is trying to free large parts of the cache such as is done by drop_caches Also, perhaps arc_reclaim_lock should be a spinlock, and this code eliminated. AKAMAI: zfs: CR 3593801 Reviewed-by: Tim Chase Reviewed-by: Richard Yao Reviewed-by: Brian Behlendorf Signed-off-by: Debabrata Banerjee Issue #6035 --- module/zfs/arc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/arc.c b/module/zfs/arc.c index b18c7a586275..8ef37cb4fa60 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -4416,7 +4416,7 @@ __arc_shrinker_func(struct shrinker *shrink, struct shrink_control *sc) /* Reclaim in progress */ if (mutex_tryenter(&arc_reclaim_lock) == 0) { ARCSTAT_INCR(arcstat_need_free, ptob(sc->nr_to_scan)); - return (SHRINK_STOP); + return (0); } mutex_exit(&arc_reclaim_lock);