rcu: Stop shrinker loop
PATCH 1/1 rcu: Stop shrinker loop
The count and scan can be separated in time. It is a fair chance that all work is already done when the scan starts. It then might retry. This is can be avoided with returning SHRINK_STOP.
--- kernel/rcu/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcu/tree.c +1 -1
@@ -3310,7 +3310,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 = {
Signature · 1 line
2.17.1
Quoted 14 lines · Peter Enderborg
The count and scan can be separated in time. It is a fair chance that all work is already done when the scan starts. It then might retry. This is can be avoided with returning
SHRINK_STOP.Signed-off-by Peter Enderborg <[email protected]>--- kernel/rcu/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/rcu/tree.c +0
-0
kernel/rcu/tree.c kfree_rcu_shrink_scan(struct shrinker *shrink, struct shrink_control *sc) · line 3315
Quoted 7 lines
kernel/rcu/tree.c +1
-1@@ -3310,7 +3310,7 @@ kfree_rcu_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)break ; } -return freed; +return freed ==0 ?SHRINK_STOP : freed; }
The loop will be stopped anyway sooner or later, but sooner is better :) To me that change makes sense.
--
Vlad Rezki
Quoted 18 lines · Uladzislau Rezki
Quoted 17 lines · Peter Enderborg
The count and scan can be separated in time. It is a fair chance that all work is already done when the scan starts. It then might retry. This is can be avoided with returning
SHRINK_STOP.Signed-off-by Peter Enderborg <[email protected]>--- kernel/rcu/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/rcu/tree.c +0
-0@@ -3310,7 +3310,7 @@ kfree_rcu_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)break ; }
Quoted 8 lines
kernel/rcu/tree.c kfree_rcu_shrink_scan(struct shrinker *shrink, struct shrink_control *sc) · line 3315
Quoted 4 lines
kernel/rcu/tree.c +1
-1-return freed; +return freed ==0 ?SHRINK_STOP : freed; }The loop will be stopped anyway sooner or later, but sooner is better :) To me that change makes sense.
Reviewed-by Uladzislau Rezki (Sony) <[email protected]>
Queued, thank you both!
Thanx, Paul
Uladzislau Rezki
maintainerQuoted 26 lines · Uladzislau Rezki
Quoted 25 lines · Peter Enderborg
Quoted 14 lines
The count and scan can be separated in time. It is a fair chance that all work is already done when the scan starts. It then might retry. This is can be avoided with returning
SHRINK_STOP.Signed-off-by Peter Enderborg <[email protected]>--- kernel/rcu/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/rcu/tree.c +0
-0kernel/rcu/tree.c kfree_rcu_shrink_scan(struct shrinker *shrink, struct shrink_control *sc) · line 3315
Quoted 7 lines
kernel/rcu/tree.c +1
-1@@ -3310,7 +3310,7 @@ kfree_rcu_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)break ; } -return freed; +return freed ==0 ?SHRINK_STOP : freed; }The loop will be stopped anyway sooner or later, but sooner is better :) To me that change makes sense.
Quoted 4 lines
Quoted 1 line
Reviewed-by Uladzislau Rezki (Sony) <[email protected]>Queued, thank you both!
Thank you, Paul!
--
Vlad Rezki