Skip to content

Commit c6dfd72

Browse files
Peter Enderborgpaulmckrcu
authored andcommitted
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]>
1 parent e40bb92 commit c6dfd72

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/rcu/tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3332,7 +3332,7 @@ kfree_rcu_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
33323332
break;
33333333
}
33343334

3335-
return freed;
3335+
return freed == 0 ? SHRINK_STOP : freed;
33363336
}
33373337

33383338
static struct shrinker kfree_rcu_shrinker = {

0 commit comments

Comments
 (0)