Re: [PATCH RFC 00/33] Compile-time thread-safety checking
From: Peter Zijlstra
Date: Fri Feb 07 2025 - 03:42:37 EST
On Thu, Feb 06, 2025 at 10:34:09AM -0800, Bart Van Assche wrote:
> I'm looking forward to the feedback from others about what their opinion
> is about how to enable thread-safety checking in the Linux kernel.
So Bart's patches are rather SHOUTING A LOT:-(, which I find really
jarring to look at.
Also, however much I despise the sparse thing, that is something we
already have some of, so we might as well adapt that.
But I should probably go read up on the whole clang feature first.
I've seen both have a __guarded_by() variant for structure members, can
you stack those?
Eg. perf has locking where a structure has both a raw_spinlock_t and a
mutex and modification requires holding both, but holding either is
sufficient for reading.