Re: Thread Safety Analysis and the Linux kernel

Marco Elver
2025-03-07T12:01:33Z

On Thu, 6 Mar 2025 at 01:09, Puchert, Aaron <aaron.puchert@sap.com> wrote:
> From: Marco Elver <elver@google.com>
> > Hi Aaron ^ 2,
> >
> > [+Cc a bunch of folks that were involved in discussions.]
> >
> > After sending v2 of the -Wthread-safety / Capability Analysis patches
> > for the Linux kernel [1], a number of concrete improvements to
> > -Wthread-safety will be required sooner or later. It is unclear if
> > they are blockers to the Linux kernel's adoption because the feature
> > is currently designed as "opt-in per subsystem", but it's clear the
> > current state of things is not ideal.
> >
> > [1] https://lore.kernel.org/all/20250304092417.2873893-1-elver@google.com/
>
> First of all, in addition to the documentation at https://clang.llvm.org/docs/ThreadSafetyAnalysis.html that you're already aware of, I can also recommend the paper by some of the original authors at https://static.googleusercontent.com/media/research.google.com/en/us/pubs/archive/42958.pdf.

Thanks for your detailed responses!

Besides the discussion in concurrent mail threads (pun intended), I
just wanted to also mention the issue of who/when/how: after all is
said and done, and we have narrowed down what is missing, the question
is who can help implement things on the Clang side?

I will offer what I've done so far: try to dig in and see how far I
get (like for -Wthread-safety-pointer), but it's going to be ~months
this way. Someone more familiar with the Clang frontend and
Wthread-safety might fare better.

Any additional help and guidance will be much appreciated.

Thanks,
-- Marco