Re: [PATCH tip/locking/core] compiler-context-analysis: Support immediate acquisition after initialization
From: Christoph Hellwig
Date: Fri Jan 16 2026 - 10:27:46 EST
On Fri, Jan 16, 2026 at 04:20:16PM +0100, Peter Zijlstra wrote:
> is *much* clearer than something like:
>
> spinlock_init(&obj->lock);
> // init
> spinlock_deinit(&obj->lock);
>
> Exactly because it has explicit scope. (also my deinit naming might not
> be optimal, it is ambiguous at best, probably confusing).
WTF is spinlock_deinit even supposed to be?
I though this is about:
spin_lock_init(&obj->lock);
spin_lock(&obj->lock);
> Not to mention that the scope things are far more robust vs error paths.
They are just a really hacked up clumsy way to provide what a very
limited version of what the capability analys provides, while messing
up the code.