* [PATCH] rcu: Stop shrinker loop
@ 2020-06-04 10:23 Peter Enderborg
2020-06-04 13:42 ` Uladzislau Rezki
0 siblings, 1 reply; 4+ messages in thread
From: Peter Enderborg @ 2020-06-04 10:23 UTC (permalink / raw)
To: Paul E . McKenney, Josh Triplett, Steven Rostedt,
Mathieu Desnoyers, Lai Jiangshan, Joel Fernandes, rcu,
linux-kernel
Cc: 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 <peter.enderborg@sony.com>
---
kernel/rcu/tree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index c716eadc7617..8b36c6b2887d 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -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 = {
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] rcu: Stop shrinker loop
2020-06-04 10:23 [PATCH] rcu: Stop shrinker loop Peter Enderborg
@ 2020-06-04 13:42 ` Uladzislau Rezki
2020-06-04 16:31 ` Paul E. McKenney
0 siblings, 1 reply; 4+ messages in thread
From: Uladzislau Rezki @ 2020-06-04 13:42 UTC (permalink / raw)
To: Peter Enderborg, Paul E . McKenney
Cc: Paul E . McKenney, Josh Triplett, Steven Rostedt,
Mathieu Desnoyers, Lai Jiangshan, Joel Fernandes, rcu,
linux-kernel
On Thu, Jun 04, 2020 at 12:23:20PM +0200, Peter Enderborg wrote:
> 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 <peter.enderborg@sony.com>
> ---
> kernel/rcu/tree.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index c716eadc7617..8b36c6b2887d 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -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.
Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
--
Vlad Rezki
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rcu: Stop shrinker loop
2020-06-04 13:42 ` Uladzislau Rezki
@ 2020-06-04 16:31 ` Paul E. McKenney
2020-06-04 18:39 ` Uladzislau Rezki
0 siblings, 1 reply; 4+ messages in thread
From: Paul E. McKenney @ 2020-06-04 16:31 UTC (permalink / raw)
To: Uladzislau Rezki
Cc: Peter Enderborg, Josh Triplett, Steven Rostedt,
Mathieu Desnoyers, Lai Jiangshan, Joel Fernandes, rcu,
linux-kernel
On Thu, Jun 04, 2020 at 03:42:55PM +0200, Uladzislau Rezki wrote:
> On Thu, Jun 04, 2020 at 12:23:20PM +0200, Peter Enderborg wrote:
> > 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 <peter.enderborg@sony.com>
> > ---
> > kernel/rcu/tree.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> > index c716eadc7617..8b36c6b2887d 100644
> > --- a/kernel/rcu/tree.c
> > +++ b/kernel/rcu/tree.c
> > @@ -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.
>
> Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Queued, thank you both!
Thanx, Paul
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rcu: Stop shrinker loop
2020-06-04 16:31 ` Paul E. McKenney
@ 2020-06-04 18:39 ` Uladzislau Rezki
0 siblings, 0 replies; 4+ messages in thread
From: Uladzislau Rezki @ 2020-06-04 18:39 UTC (permalink / raw)
To: Paul E. McKenney
Cc: Uladzislau Rezki, Peter Enderborg, Josh Triplett, Steven Rostedt,
Mathieu Desnoyers, Lai Jiangshan, Joel Fernandes, rcu,
linux-kernel
> On Thu, Jun 04, 2020 at 03:42:55PM +0200, Uladzislau Rezki wrote:
> > On Thu, Jun 04, 2020 at 12:23:20PM +0200, Peter Enderborg wrote:
> > > 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 <peter.enderborg@sony.com>
> > > ---
> > > kernel/rcu/tree.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> > > index c716eadc7617..8b36c6b2887d 100644
> > > --- a/kernel/rcu/tree.c
> > > +++ b/kernel/rcu/tree.c
> > > @@ -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.
> >
> > Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
>
> Queued, thank you both!
>
Thank you, Paul!
--
Vlad Rezki
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-06-04 18:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-04 10:23 [PATCH] rcu: Stop shrinker loop Peter Enderborg
2020-06-04 13:42 ` Uladzislau Rezki
2020-06-04 16:31 ` Paul E. McKenney
2020-06-04 18:39 ` Uladzislau Rezki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).