Commit c6dfd72b authored by Peter Enderborg's avatar Peter Enderborg Committed by Paul E. McKenney
Browse files

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: default avatarUladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: default avatarPeter Enderborg <peter.enderborg@sony.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent e40bb921
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 = {