aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Enderborg <[email protected]>2020-06-04 12:23:20 +0200
committerPaul E. McKenney <[email protected]>2020-06-29 11:58:51 -0700
commitc6dfd72b7a3b70a2054db0f73245ea2f762a8452 (patch)
treede84fe185c47b0945e168f5ee0220699289ed060
parente40bb921119814c6f746891af9cd37eccda616a4 (diff)
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) <[email protected]> Signed-off-by: Peter Enderborg <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
-rw-r--r--kernel/rcu/tree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index d17e5a08bf43..c8196fab563c 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 = {