From: "Paul E. McKenney" <paulmck@kernel.org>
To: Michal Schmidt <mschmidt@redhat.com>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>,
Josh Triplett <josh@joshtriplett.org>,
Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
"Uladzislau Rezki (Sony)" <urezki@gmail.com>,
rcu@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rcu/srcutiny: don't return before reenabling preemption
Date: Wed, 9 Oct 2024 10:19:01 -0700 [thread overview]
Message-ID: <6c9dde7f-271b-4342-8ce9-8f363b341c0d@paulmck-laptop> (raw)
In-Reply-To: <20241007101415.466155-1-mschmidt@redhat.com>
On Mon, Oct 07, 2024 at 12:14:15PM +0200, Michal Schmidt wrote:
> Code after the return statement is dead. Enable preemption before
> returning from srcu_drive_gp().
>
> This will be important when/if PREEMPT_AUTO (lazy resched) gets merged.
>
> Fixes: 65b4a59557f6 ("srcu: Make Tiny SRCU explicitly disable preemption")
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Good catch!
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
> ---
> kernel/rcu/srcutiny.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/rcu/srcutiny.c b/kernel/rcu/srcutiny.c
> index 549c03336ee9..4dcbf8aa80ff 100644
> --- a/kernel/rcu/srcutiny.c
> +++ b/kernel/rcu/srcutiny.c
> @@ -122,8 +122,8 @@ void srcu_drive_gp(struct work_struct *wp)
> ssp = container_of(wp, struct srcu_struct, srcu_work);
> preempt_disable(); // Needed for PREEMPT_AUTO
> if (ssp->srcu_gp_running || ULONG_CMP_GE(ssp->srcu_idx, READ_ONCE(ssp->srcu_idx_max))) {
> - return; /* Already running or nothing to do. */
> preempt_enable();
> + return; /* Already running or nothing to do. */
> }
>
> /* Remove recently arrived callbacks and wait for readers. */
> --
> 2.46.2
>
next prev parent reply other threads:[~2024-10-09 17:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-07 10:14 Michal Schmidt
2024-10-09 17:19 ` Paul E. McKenney [this message]
2024-10-18 21:10 ` Frederic Weisbecker
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=6c9dde7f-271b-4342-8ce9-8f363b341c0d@paulmck-laptop \
--to=paulmck@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mschmidt@redhat.com \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=urezki@gmail.com \
/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
all inboxes | Powered by JetHome®