Only wakeup waiters if we've actually done work

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
This commit is contained in:
Debabrata Banerjee 2017-03-15 19:30:29 -04:00 committed by Brian Behlendorf
parent 2e91c2fb1a
commit 1a31dcf53c
1 changed files with 5 additions and 5 deletions

View 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