From: Bart Van Assche <bvanassche@acm.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
Boqun Feng <boqun@kernel.org>, Waiman Long <longman@redhat.com>,
linux-kernel@vger.kernel.org, Marco Elver <elver@google.com>,
"Paul E . McKenney" <paulmck@kernel.org>,
Christoph Hellwig <hch@lst.de>,
Bart Van Assche <bvanassche@acm.org>
Subject: [PATCH v4 0/3] Fix three Clang context analysis issues
Date: Wed, 18 Nov 2026 15:09:56 -0800 [thread overview]
Message-ID: <cover.1795043161.git.bvanassche@acm.org> (raw)
Hi Peter and Marco,
This patch series includes three context analysis fixes:
- bit_spinlock: Surround the bitnum argument and macro expansion in
__bitlock() with parentheses to avoid operator precedence issues.
- cleanup: Mark __free() helper functions generated by DEFINE_FREE() as
__context_unsafe() because cleanup expressions that unlock trigger
Clang thread-safety false positives.
- srcu: Guard the __srcu_read_lock_must_hold() call in srcu_dereference_check()
with const_true(!(c)) so update-side callers satisfying the lockdep condition
do not fail context analysis.
Please consider this patch series for the next merge window.
Thanks,
Bart.
Changes compared to v3:
- Reworked patch 3/3 such that __srcu_read_lock_must_hold() remains in
srcu_dereference_check().
Changes compared to v2:
- Split out only the three standalone context analysis fixes (v2 patches
1, 2, and 4) into this series.
- Dropped the lockdep and RCU assertion behavior changes (v2 patches
8-14: lockdep_assume_*(), lockdep_assume_in_rcu_*(), and removing
context assumptions from lockdep_assert_held*() and
lockdep_assert_in_rcu_*()), as agreed in the review discussion [2].
- Dropped the preparatory __must_hold*() annotation patches (v2 patches
5-7) and the tracing branch profiling Kconfig patch (v2 patch 3) from
this series.
- Updated the commit message of "cleanup: Disable context analysis for
__free() helpers" with concrete examples of __free() unlock helpers
in response to review feedback.
- Rebased onto current mainline.
Bart Van Assche (3):
bit_spinlock: Fix the __bitlock() definition
cleanup: Disable context analysis for __free() helpers
srcu: Make the srcu_dereference_check() reader lock check conditional
include/linux/bit_spinlock.h | 2 +-
include/linux/cleanup.h | 6 ++++--
include/linux/srcu.h | 13 +++++++++++--
3 files changed, 16 insertions(+), 5 deletions(-)
next reply other threads:[~2026-11-18 23:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 23:09 Bart Van Assche [this message]
2026-11-18 23:09 ` [PATCH v4 1/3] bit_spinlock: Fix the __bitlock() definition Bart Van Assche
2026-11-18 23:09 ` [PATCH v4 2/3] cleanup: Disable context analysis for __free() helpers Bart Van Assche
2026-11-18 23:09 ` [PATCH v4 3/3] srcu: Make the srcu_dereference_check() reader lock check conditional Bart Van Assche
2026-11-18 23:47 ` Paul E. McKenney
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=cover.1795043161.git.bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=boqun@kernel.org \
--cc=elver@google.com \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mingo@redhat.com \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.