Skip to content

Commit

Permalink
rcu: Stop shrinker loop
Browse files Browse the repository at this point in the history
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]>
Change-Id: Ie2c737d309a899d12dff77019216103a4f12c026
Signed-off-by: Peter Enderborg <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
(cherry picked from commit c6dfd72b7a3b70a2054db0f73245ea2f762a8452)
  • Loading branch information
Peter Enderborg authored and saikiran2001-v2 committed Jan 31, 2023
1 parent 8ef43b6 commit 0b4523d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/rcu/tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -3040,7 +3040,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 = {
Expand Down

0 comments on commit 0b4523d

Please sign in to comment.