]> granicus.if.org Git - zfs/commitdiff
Only wakeup waiters if we've actually done work
authorDebabrata Banerjee <dbanerje@akamai.com>
Wed, 15 Mar 2017 23:30:29 +0000 (19:30 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 2 May 2017 19:50:02 +0000 (15:50 -0400)
AKAMAI: zfs: CR 3695072
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 8ef37cb4fa60c75bbb43867bf2e034f0f3fb1b9f..79b04f45564f6111acb2d2818b881ca71b38e621 100644 (file)
@@ -4434,16 +4434,16 @@ __arc_shrinker_func(struct shrinker *shrink, struct shrink_control *sc)
 #else
                pages = btop(arc_evictable_memory());
 #endif
+               /*
+                * We've shrunk what we can, wake up threads.
+                */
+               cv_broadcast(&arc_reclaim_waiters_cv);
+
        } else {
                arc_kmem_reap_now();
                pages = SHRINK_STOP;
        }
 
-       /*
-        * We've reaped what we can, wake up threads.
-        */
-       cv_broadcast(&arc_reclaim_waiters_cv);
-
        /*
         * When direct reclaim is observed it usually indicates a rapid
         * increase in memory pressure.  This occurs because the kswapd