summaryrefslogtreecommitdiffstats
path: root/module/zfs/arc.c
diff options
context:
space:
mode:
authorDebabrata Banerjee <[email protected]>2017-03-15 19:30:29 -0400
committerBrian Behlendorf <[email protected]>2017-05-02 15:50:02 -0400
commit1a31dcf53cd71c3c71db343fc4c9ab1dfa326d3f (patch)
treec9cbe60d3263e38401e8abe8e6a70e8ad42b786f /module/zfs/arc.c
parent2e91c2fb1a47f98c2dc06725c284db16d852a618 (diff)
Only wakeup waiters if we've actually done work
AKAMAI: zfs: CR 3695072 Reviewed-by: Tim Chase <[email protected]> Reviewed-by: Richard Yao <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Debabrata Banerjee <[email protected]> Issue #6035
Diffstat (limited to 'module/zfs/arc.c')
-rw-r--r--module/zfs/arc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/module/zfs/arc.c b/module/zfs/arc.c
index 8ef37cb4f..79b04f455 100644
--- a/module/zfs/arc.c
+++ b/module/zfs/arc.c
@@ -4434,17 +4434,17 @@ __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
* threads were unable to asynchronously keep enough free memory