From: Christoph Hellwig <hch@lst.de>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Christoph Hellwig <hch@lst.de>, Marco Elver <elver@google.com>,
Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Will Deacon <will@kernel.org>, Boqun Feng <boqun.feng@gmail.com>,
Waiman Long <longman@redhat.com>,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
Bart Van Assche <bvanassche@acm.org>
Subject: Re: [PATCH tip/locking/core] compiler-context-analysis: Support immediate acquisition after initialization
Date: Thu, 22 Jan 2026 07:25:54 +0100 [thread overview]
Message-ID: <20260122062554.GA24403@lst.de> (raw)
In-Reply-To: <20260121202427.099c36ab@gandalf.local.home>
On Wed, Jan 21, 2026 at 08:24:27PM -0500, Steven Rostedt wrote:
> I haven't seen all the other approaches, but would a macro be able to hide
> it with some kind of obfuscation from the compiler?
>
>
> GUARD_INIT(obj->state, INIT_STATE);
>
> which would be something like a WRITE_ONCE() macro. I'm not sure what
> tooling there is to disable checks for a small bit of code like this.
Well, you don't really want WRITE_ONCE for every field, but basically
a barrier. And initializing the lock seems like a very logical
place for such a barrier. So we'd probably need to pair it with a some
kind of 'start initializing fields' that starts the context, and the
init then ends it.
next prev parent reply other threads:[~2026-01-22 6:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-15 0:51 [PATCH tip/locking/core] compiler-context-analysis: Support immediate acquisition after initialization Marco Elver
2026-01-15 17:22 ` Bart Van Assche
2026-01-15 17:58 ` Marco Elver
2026-01-15 18:04 ` Bart Van Assche
2026-01-15 21:33 ` Peter Zijlstra
2026-01-16 1:17 ` Marco Elver
2026-01-16 15:07 ` Peter Zijlstra
2026-01-16 15:10 ` Christoph Hellwig
2026-01-16 15:20 ` Peter Zijlstra
2026-01-16 15:27 ` Peter Zijlstra
2026-01-16 15:27 ` Christoph Hellwig
2026-01-16 15:37 ` Marco Elver
2026-01-16 15:47 ` Peter Zijlstra
2026-01-19 9:10 ` Christoph Hellwig
2026-01-22 1:24 ` Steven Rostedt
2026-01-22 6:25 ` Christoph Hellwig [this message]
2026-01-22 9:15 ` Marco Elver
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=20260122062554.GA24403@lst.de \
--to=hch@lst.de \
--cc=boqun.feng@gmail.com \
--cc=bvanassche@acm.org \
--cc=elver@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=longman@redhat.com \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=will@kernel.org \
/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