From: "Paul E. McKenney" <paulmck@kernel.org>
To: Joel Fernandes <joelagnelf@nvidia.com>
Cc: rcu <rcu@vger.kernel.org>, Steven Rostedt <rostedt@goodmis.org>,
linux-kernel@vger.kernel.org, Davidlohr Bueso <dave@stgolabs.net>,
Josh Triplett <josh@joshtriplett.org>,
Frederic Weisbecker <frederic@kernel.org>,
Neeraj Upadhyay <neeraj.upadhyay@kernel.org>,
Boqun Feng <boqun.feng@gmail.com>,
Uladzislau Rezki <urezki@gmail.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Lai Jiangshan <jiangshanlai@gmail.com>,
Zqiang <qiang.zhang@linux.dev>
Subject: Re: [RFC] jiffies_till_first_fqs off by 1
Date: Tue, 23 Dec 2025 15:53:23 -0800 [thread overview]
Message-ID: <2f95e414-7d0e-4e2a-9656-25abf84c27ec@paulmck-laptop> (raw)
In-Reply-To: <1efce983-639b-430d-a613-03baef81c416@nvidia.com>
On Tue, Dec 23, 2025 at 12:38:19PM -0500, Joel Fernandes wrote:
> Hello,
>
> During studying some synchronize_rcu() latencies, I found that the
> jiffies_till_first_fqs value passed to the timer tick subsystem does is always
> off by one. This is natural due to calc_index() rounding up.
>
> For example, jiffies_till_first_fqs=3 means the "Jiffies till first FQS" delay
> is actually 4ms. And same for the next FQS. In fact, in testing it shows it can
> never ever be 3ms for HZ=1000. And in rare cases, it will go to 5ms probably due
> to interrupts.
>
> Considering this, I think it is better to reduce the jiffies_till_first_fqs by 1
> before passing it to the wait APIs.
>
> But before I wanted to send a patch, I wanted to get everyone's thoughts.
> Considering this the RFC.
Inadvertent passing of the value zero?
> The other place I found this was when call_rcu_hurry() is called, but the GP
> thread takes a tick to wake up, but this isn't related to the timer per-se, it
> is just that we don't want to wake the GP thread too often. So we just wait for
> the next tick to notice callbacks before doing a wakeup.
>
> Heh, and this means synchronize_rcu() latencies will multiply when HZ < 1000. I
> wonder if this is also what caused Uladzislau to investigate it for mobile devices.
Quite possibly!
Back in the day, the theory was that lower HZ tended to imply less-capable
CPUs, and thus a need to lighten the load. So there might need to be
some adjustment for present-day hardware.
Thanx, Paul
next prev parent reply other threads:[~2025-12-23 23:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-23 17:38 Joel Fernandes
2025-12-23 23:53 ` Paul E. McKenney [this message]
2025-12-24 2:06 ` Joel Fernandes
2025-12-25 18:54 ` Paul E. McKenney
2025-12-26 2:15 ` Joel Fernandes
2026-01-01 22:24 ` Paul E. McKenney
2026-01-02 2:59 ` Joel Fernandes
2026-01-02 3:41 ` Paul E. McKenney
2026-01-02 17:58 ` Joel Fernandes
2026-01-02 19:50 ` Paul E. McKenney
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=2f95e414-7d0e-4e2a-9656-25abf84c27ec@paulmck-laptop \
--to=paulmck@kernel.org \
--cc=boqun.feng@gmail.com \
--cc=dave@stgolabs.net \
--cc=frederic@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=joelagnelf@nvidia.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=neeraj.upadhyay@kernel.org \
--cc=qiang.zhang@linux.dev \
--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®