]> granicus.if.org Git - zfs/commitdiff
Do not stop kernel shrinker on lock contention
authorDebabrata Banerjee <dbanerje@akamai.com>
Wed, 15 Mar 2017 22:50:32 +0000 (18:50 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 2 May 2017 19:49:48 +0000 (15:49 -0400)
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 <tim@chase2k.com>
Reviewed-by: Richard Yao <ryao@gentoo.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Debabrata Banerjee <dbanerje@akamai.com>
Issue #6035

module/zfs/arc.c

index b18c7a58627580cc76f98c084bb586a27ae98728..8ef37cb4fa60c75bbb43867bf2e034f0f3fb1b9f 100644 (file)
@@ -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);