From: Rik van Riel <riel@surriel.com>
To: Usama Arif <usama.arif@linux.dev>,
anna-maria@linutronix.de, frederic@kernel.org,
linux-kernel@vger.kernel.org, mingo@kernel.org, tglx@kernel.org
Cc: hannes@cmpxchg.org, shakeel.butt@linux.dev
Subject: Re: [PATCH v2] tick/nohz: Avoid unused timekeeping_max_deferment() calls
Date: Sun, 27 Sep 2026 09:08:45 -0400 [thread overview]
Message-ID: <ad2b5eaf6ec0d238ef42d4791e3754b73cb540ed.camel@surriel.com> (raw)
In-Reply-To: <20260918133408.2834751-1-usama.arif@linux.dev>
On Fri, 2026-09-18 at 06:34 -0700, Usama Arif wrote:
> tick_nohz_next_event() limits a CPU's sleep interval to the maximum
> deferment supported by the current clocksource when that CPU owns the
> do_timer() duty. If the duty is unassigned, the limit also applies
> when
> the CPU's TS_FLAG_DO_TIMER_LAST flag is set.
>
> After the early timer checks, the function currently reads the
> maximum
> deferment unconditionally. It then replaces the result with KTIME_MAX
> unless one of the two conditions above applies.
>
> timekeeping_max_deferment() performs a seqcount-protected read of the
> shared timekeeper and follows its clocksource pointer. Check the
> do_timer
> state first and avoid this work when the result would be discarded.
> This
> leaves the resulting expiry unchanged and reduces accesses to
> timekeeper
> data that is modified regularly.
>
> On x86-64 this removes 18-20 dynamically executed instructions,
> including
> the call, from the common non-owner path when the seqcount does not
> retry.
>
> Signed-off-by: Usama Arif <usama.arif@linux.dev>
The changelog confused me a little at first, but after
reading through the code it all made sense.
Reviewed-by: Rik van Riel <riel@surriel.com>
--
All Rights Reversed.
next prev parent reply other threads:[~2026-09-27 13:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 13:34 Usama Arif
2026-09-25 9:16 ` Usama Arif
2026-09-27 13:08 ` Rik van Riel [this message]
2026-09-29 19:05 ` [tip: timers/nohz] " tip-bot2 for Usama Arif
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=ad2b5eaf6ec0d238ef42d4791e3754b73cb540ed.camel@surriel.com \
--to=riel@surriel.com \
--cc=anna-maria@linutronix.de \
--cc=frederic@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=shakeel.butt@linux.dev \
--cc=tglx@kernel.org \
--cc=usama.arif@linux.dev \
/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®