[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <552e940f-df40-4776-916e-78decdaafb49@acm.org>
Date: Thu, 6 Feb 2025 10:40:16 -0800
From: Bart Van Assche <bvanassche@....org>
To: Marco Elver <elver@...gle.com>
Cc: "Paul E. McKenney" <paulmck@...nel.org>,
Alexander Potapenko <glider@...gle.com>, Bill Wendling <morbo@...gle.com>,
Boqun Feng <boqun.feng@...il.com>, Dmitry Vyukov <dvyukov@...gle.com>,
Frederic Weisbecker <frederic@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Ingo Molnar <mingo@...nel.org>, Jann Horn <jannh@...gle.com>,
Joel Fernandes <joel@...lfernandes.org>, Jonathan Corbet <corbet@....net>,
Josh Triplett <josh@...htriplett.org>, Justin Stitt
<justinstitt@...gle.com>, Kees Cook <kees@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Miguel Ojeda <ojeda@...nel.org>, Nathan Chancellor <nathan@...nel.org>,
Neeraj Upadhyay <neeraj.upadhyay@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Peter Zijlstra <peterz@...radead.org>, Steven Rostedt <rostedt@...dmis.org>,
Thomas Gleixner <tglx@...utronix.de>, Uladzislau Rezki <urezki@...il.com>,
Waiman Long <longman@...hat.com>, Will Deacon <will@...nel.org>,
kasan-dev@...glegroups.com, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev, rcu@...r.kernel.org, linux-crypto@...r.kernel.org
Subject: Re: [PATCH RFC 01/24] compiler_types: Move lock checking attributes
to compiler-capability-analysis.h
On 2/6/25 10:09 AM, Marco Elver wrote:
> +/* Sparse context/lock checking support. */
> +# define __must_hold(x) __attribute__((context(x,1,1)))
> +# define __acquires(x) __attribute__((context(x,0,1)))
> +# define __cond_acquires(x) __attribute__((context(x,0,-1)))
> +# define __releases(x) __attribute__((context(x,1,0)))
> +# define __acquire(x) __context__(x,1)
> +# define __release(x) __context__(x,-1)
> +# define __cond_lock(x, c) ((c) ? ({ __acquire(x); 1; }) : 0)
If support for Clang thread-safety attributes is added, an important
question is what to do with the sparse context attribute. I think that
more developers are working on improving and maintaining Clang than
sparse. How about reducing the workload of kernel maintainers by
only supporting the Clang thread-safety approach and by dropping support
for the sparse context attribute?
Thanks,
Bart.
Powered by blists - more mailing lists