[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260122062554.GA24403@lst.de>
Date: Thu, 22 Jan 2026 07:25:54 +0100
From: Christoph Hellwig <hch@....de>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Peter Zijlstra <peterz@...radead.org>, Christoph Hellwig <hch@....de>,
Marco Elver <elver@...gle.com>, Ingo Molnar <mingo@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>, Will Deacon <will@...nel.org>,
Boqun Feng <boqun.feng@...il.com>, Waiman Long <longman@...hat.com>,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
Bart Van Assche <bvanassche@....org>
Subject: Re: [PATCH tip/locking/core] compiler-context-analysis: Support
immediate acquisition after initialization
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.
Powered by blists - more mailing lists