From: Peter Enderborg Date: Thu, 4 Jun 2020 10:23:20 +0000 (+0200) Subject: rcu: Stop shrinker loop X-Git-Tag: v5.9-rc1~204^2^2^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c6dfd72b7a3b70a2054db0f73245ea2f762a8452;p=thirdparty%2Fkernel%2Flinux.git rcu: Stop shrinker loop The count and scan can be separated in time, and there is a fair chance that all work is already done when the scan starts, which might in turn result in a needless retry. This commit therefore avoids this retry by returning SHRINK_STOP. Reviewed-by: Uladzislau Rezki (Sony) Signed-off-by: Peter Enderborg Signed-off-by: Paul E. McKenney --- diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index d17e5a08bf43f..c8196fab563c2 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -3332,7 +3332,7 @@ kfree_rcu_shrink_scan(struct shrinker *shrink, struct shrink_control *sc) break; } - return freed; + return freed == 0 ? SHRINK_STOP : freed; } static struct shrinker kfree_rcu_shrinker = {