From: Peter Zijlstra <peterz@infradead.org>
To: Bart Van Assche <bvanassche@acm.org>
Cc: elver@google.com, linux-kernel@vger.kernel.org,
bigeasy@linutronix.de, mingo@kernel.org, tglx@linutronix.de,
will@kernel.org, boqun.feng@gmail.com, longman@redhat.com,
hch@lst.de, rostedt@goodmis.org, llvm@lists.linux.dev
Subject: Re: [RFC][PATCH 3/4] locking/rtmutex: Add context analysis
Date: Wed, 21 Jan 2026 20:01:44 +0100 [thread overview]
Message-ID: <20260121190144.GK166857@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <377d5833-6876-4fea-b17f-19d4b03d8583@acm.org>
On Wed, Jan 21, 2026 at 09:15:53AM -0800, Bart Van Assche wrote:
> On 1/21/26 3:07 AM, Peter Zijlstra wrote:
> > Add compiler context analysis annotations.
> >
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > ---
> > include/linux/mutex.h | 2 +-
> > include/linux/rtmutex.h | 4 ++--
> > kernel/locking/Makefile | 2 ++
> > kernel/locking/mutex.c | 2 --
> > kernel/locking/rtmutex.c | 18 +++++++++++++++++-
> > kernel/locking/rtmutex_api.c | 3 +++
> > kernel/locking/rtmutex_common.h | 22 ++++++++++++++++------
> > kernel/locking/ww_mutex.h | 18 +++++++++++++-----
> > kernel/locking/ww_rt_mutex.c | 1 +
> > 9 files changed, 55 insertions(+), 17 deletions(-)
>
> The patch subject says "rtmutex" but this patch includes a change for
> the header file include/linux/mutex.h. Shouldn't that change be moved
> into the mutex patch?
Clearly I suffered from wandering hunks syndrome while doing these :/
> > --- a/kernel/locking/mutex.c
> > +++ b/kernel/locking/mutex.c
> > @@ -848,7 +848,6 @@ EXPORT_SYMBOL_GPL(mutex_lock_nested);
> > void __sched
> > _mutex_lock_nest_lock(struct mutex *lock, struct lockdep_map *nest)
> > - __acquires(lock)
> > {
> > __mutex_lock(lock, TASK_UNINTERRUPTIBLE, 0, nest, _RET_IP_);
> > __acquire(lock);
>
> Shouldn't the "__acquires()" annotation be moved to the declaration in
> <linux/mutex.h>?
It is, but yeah, this should be in the previous patch.
> > #define MUTEX mutex
> > #define MUTEX_WAITER mutex_waiter
> > +#define MUST_HOLD_WAIT_LOCK __must_hold(&lock->wait_lock)
> > static inline struct mutex_waiter *
> > __ww_waiter_first(struct mutex *lock)
> > @@ -97,9 +98,11 @@ static inline void lockdep_assert_wait_l
> > #define MUTEX rt_mutex
> > #define MUTEX_WAITER rt_mutex_waiter
> > +#define MUST_HOLD_WAIT_LOCK __must_hold(&lock->rtmutex.wait_lock)
>
> Is it really necessary to introduce these two macros? I prefer to see
> the __must_hold() annotations instead of the macro names.
You'd rather see something like:
__must_hold(&lock->WAIT_LOCK)
? Can do I suppose.
next prev parent reply other threads:[~2026-01-21 19:01 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-21 11:07 [RFC][PATCH 0/4] locking: Add/convert context analysis bits Peter Zijlstra
2026-01-21 11:07 ` [RFC][PATCH 1/4] compiler-context-analysys: Add __cond_releases() Peter Zijlstra
2026-01-21 13:09 ` Marco Elver
2026-01-21 17:55 ` Bart Van Assche
2026-01-21 18:35 ` Marco Elver
2026-01-21 19:02 ` Peter Zijlstra
2026-01-21 21:02 ` Bart Van Assche
2026-03-09 19:48 ` [tip: locking/core] " tip-bot2 for Peter Zijlstra
2026-01-21 11:07 ` [RFC][PATCH 2/4] locking/mutex: Add context analysis Peter Zijlstra
2026-01-21 17:11 ` Bart Van Assche
2026-01-21 18:59 ` Peter Zijlstra
2026-03-09 19:48 ` [tip: locking/core] " tip-bot2 for Peter Zijlstra
2026-01-21 11:07 ` [RFC][PATCH 3/4] locking/rtmutex: " Peter Zijlstra
2026-01-21 17:15 ` Bart Van Assche
2026-01-21 19:01 ` Peter Zijlstra [this message]
2026-03-09 19:48 ` [tip: locking/core] " tip-bot2 for Peter Zijlstra
2026-01-21 11:07 ` [RFC][PATCH 4/4] futex: Convert to compiler " Peter Zijlstra
2026-01-21 13:19 ` Peter Zijlstra
2026-03-18 8:02 ` [tip: locking/core] " tip-bot2 for Peter Zijlstra
2026-01-21 13:07 ` [RFC][PATCH 0/4] locking: Add/convert context analysis bits Marco Elver
2026-01-21 19:23 ` Peter Zijlstra
2026-01-21 20:37 ` Bart Van Assche
2026-01-22 9:04 ` Peter Zijlstra
2026-01-22 16:28 ` Bart Van Assche
2026-01-22 18:58 ` Nathan Chancellor
2026-01-23 11:06 ` Peter Zijlstra
2026-01-23 11:15 ` Peter Zijlstra
2026-01-23 18:58 ` Bart Van Assche
2026-01-23 20:15 ` Marco Elver
2026-01-23 14:16 ` Sebastian Andrzej Siewior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260121190144.GK166857@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bigeasy@linutronix.de \
--cc=boqun.feng@gmail.com \
--cc=bvanassche@acm.org \
--cc=elver@google.com \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=longman@redhat.com \
--cc=mingo@kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®