Skip to content

Commit

Permalink
Do not stop kernel shrinker on lock contention
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dbavatar authored and behlendorf committed May 2, 2017
1 parent b855550 commit 2e91c2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2e91c2f

Please sign in to comment.