Skip to content

Fix three Clang context analysis issues

Bart Van Assche lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 3 patches 1 replyIn review

Changes compared to v2 from the cover letter

- 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.

Patches in v1 No applies recorded yet

None of the 3 patches the cover letter announces are in this archive.

Reviews trailers per patch

PatchMarco Elver
SeriesR-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] Fix three Clang context analysis issues

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: Move __srcu_read_lock_must_hold() out of srcu_dereference_check() and into srcu_dereference() and srcu_dereference_notrace() 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 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: Remove check from srcu_dereference_check()

 include/linux/bit_spinlock.h |  2 +-
 include/linux/cleanup.h      |  6 ++++--
 include/linux/srcu.h         | 20 +++++++++++++++-----
 3 files changed, 20 insertions(+), 8 deletions(-)