From: Uladzislau Rezki <urezki@gmail.com>
To: Peter Enderborg <peter.enderborg@sony.com>,
"Paul E . McKenney" <paulmck@kernel.org>
Cc: "Paul E . McKenney" <paulmck@kernel.org>,
Josh Triplett <josh@joshtriplett.org>,
Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Lai Jiangshan <jiangshanlai@gmail.com>,
Joel Fernandes <joel@joelfernandes.org>,
rcu@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rcu: Stop shrinker loop
Date: Thu, 4 Jun 2020 15:42:55 +0200 [thread overview]
Message-ID: <20200604134255.GA24897@pc636> (raw)
In-Reply-To: <20200604102320.15914-1-peter.enderborg@sony.com>
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
next prev parent reply other threads:[~2020-06-04 13:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-04 10:23 [PATCH] rcu: Stop shrinker loop Peter Enderborg
2020-06-04 13:42 ` Uladzislau Rezki [this message]
2020-06-04 16:31 ` Paul E. McKenney
2020-06-04 18:39 ` Uladzislau Rezki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200604134255.GA24897@pc636 \
--to=urezki@gmail.com \
--cc=jiangshanlai@gmail.com \
--cc=joel@joelfernandes.org \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=paulmck@kernel.org \
--cc=peter.enderborg@sony.com \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).