From: Bart Van Assche <bvanassche@acm.org>
To: elver@google.com, Peter Zijlstra <peterz@infradead.org>
Cc: 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 0/4] locking: Add/convert context analysis bits
Date: Fri, 23 Jan 2026 10:58:35 -0800 [thread overview]
Message-ID: <f4f688ba-8953-4cb6-a749-94dad74692ed@acm.org> (raw)
In-Reply-To: <20260123111523.GO171111@noisy.programming.kicks-ass.net>
On 1/23/26 3:15 AM, Peter Zijlstra wrote:
> --- a/include/linux/rtmutex.h
> +++ b/include/linux/rtmutex.h
> @@ -41,7 +41,7 @@ struct rt_mutex_base {
> */
> static inline bool rt_mutex_base_is_locked(struct rt_mutex_base *lock)
> {
> - return READ_ONCE(lock->owner) != NULL;
> + return data_race(READ_ONCE(lock->owner) != NULL);
> }
>
> #ifdef CONFIG_RT_MUTEXES
> @@ -49,7 +49,7 @@ static inline bool rt_mutex_base_is_lock
>
> static inline struct task_struct *rt_mutex_owner(struct rt_mutex_base *lock)
> {
> - unsigned long owner = (unsigned long) READ_ONCE(lock->owner);
> + unsigned long owner = (unsigned long) data_race(READ_ONCE(lock->owner));
>
> return (struct task_struct *) (owner & ~RT_MUTEX_HAS_WAITERS);
> }
Marco, shouldn't lock context analysis be disabled for all READ_ONCE()
invocations? I expect that all code that uses READ_ONCE() to read a
structure member annotated with __guarded_by() will have to be annotated
with data_race(). Shouldn't the data_race() invocation be moved into the
READ_ONCE() definition?
Thanks,
Bart.
next prev parent reply other threads:[~2026-01-23 18:58 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-21 11:07 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
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 [this message]
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=f4f688ba-8953-4cb6-a749-94dad74692ed@acm.org \
--to=bvanassche@acm.org \
--cc=bigeasy@linutronix.de \
--cc=boqun.feng@gmail.com \
--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=peterz@infradead.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®