From: Joel Fernandes <joelagnelf@nvidia.com>
To: Frederic Weisbecker <frederic@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Boqun Feng <boqun.feng@gmail.com>,
Neeraj Upadhyay <neeraj.upadhyay@amd.com>,
"Paul E . McKenney" <paulmck@kernel.org>,
Uladzislau Rezki <urezki@gmail.com>,
Zqiang <qiang.zhang1211@gmail.com>, rcu <rcu@vger.kernel.org>
Subject: Re: [PATCH v2] rcu: Robustify rcu_is_cpu_rrupt_from_idle()
Date: Fri, 2 May 2025 11:13:02 -0400 [thread overview]
Message-ID: <e05f04a5-9792-445f-9c53-3c3a1edfd370@nvidia.com> (raw)
In-Reply-To: <20250429100840.13917-1-frederic@kernel.org>
On 4/29/2025 6:08 AM, Frederic Weisbecker wrote:
> RCU relies on the context tracking nesting counter in order to determine
> if it is running in extended quiescent state.
>
> However the context tracking nesting counter is not completely
> synchronized with the actual context tracking state:
>
> * The nesting counter is set to 1 or incremented further _after_ the
> actual state is set to RCU watching.
>
> * The nesting counter is set to 0 or decremented further _before_ the
> actual state is set to RCU not watching.
>
> Therefore it is safe to assume that if ct_nesting() > 0, RCU is
> watching. But if ct_nesting() <= 0, RCU is not watching except for tiny
> windows.
>
> This hasn't been a problem so far because rcu_is_cpu_rrupt_from_idle()
> has only been called from interrupts. However the code is confusing
> and abuses the role of the context tracking nesting counter while there
> are more accurate indicators available.
>
> Clarify and robustify accordingly.
>
> Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
> ---
This seems like an important change but not urgent or fixing a bug, so I will
put it in my rcu/dev branch as well so it is easy for Neeraj to take.
thanks,
- Joel
prev parent reply other threads:[~2025-05-02 15:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-29 10:08 [PATCH v2] rcu: Robustify rcu_is_cpu_rrupt_from_idle() Frederic Weisbecker
2025-05-02 15:13 ` Joel Fernandes [this message]
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=e05f04a5-9792-445f-9c53-3c3a1edfd370@nvidia.com \
--to=joelagnelf@nvidia.com \
--cc=boqun.feng@gmail.com \
--cc=frederic@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=neeraj.upadhyay@amd.com \
--cc=paulmck@kernel.org \
--cc=qiang.zhang1211@gmail.com \
--cc=rcu@vger.kernel.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