From: Nathan Chancellor <nathan@kernel.org>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Valentin Schneider <vschneid@redhat.com>,
K Prateek Nayak <kprateek.nayak@amd.com>,
Ingo Molnar <mingo@kernel.org>,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
stable@vger.kernel.org
Subject: Re: [PATCH] sched/topology: Avoid unsequenced accesses to jiffies in sd_init()
Date: Mon, 16 Nov 2026 11:54:56 -0700 [thread overview]
Message-ID: <20261116185456.GA1036399@ax162> (raw)
In-Reply-To: <avtMzjJxIpFWkW-L@google.com>
On Mon, Nov 16, 2026 at 10:36:45AM -0800, Nick Desaulniers wrote:
> On Sat, Nov 14, 2026 at 09:19:52PM -0700, Nathan Chancellor wrote:
> > + sd->last_balance = jiffies;
> > + sd->last_decay_max_lb_cost = jiffies;
>
> This pattern is going to wind up with two volatile (expensive) accesses,
> (with potentially different values) rather than one access and the same
> value by accessing `jiffies` once then storing the result in a temporary
> local (before the designated initializer), then using that to initialize
> the two fields in the designated initializer.
Thanks, I should have revisited this solution once I had a wider view of
the scope of this warning (it was one of the first patches I wrote)
because I definitely would have done that. I'll respin.
--
Cheers,
Nathan
prev parent reply other threads:[~2026-11-16 18:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-15 4:19 Nathan Chancellor
2026-11-16 18:36 ` Nick Desaulniers
2026-11-16 18:54 ` Nathan Chancellor [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=20261116185456.GA1036399@ax162 \
--to=nathan@kernel.org \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mgorman@suse.de \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=ndesaulniers@google.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=stable@vger.kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.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®