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>,
Christoph Hellwig <hch@lst.de>,
Steven Rostedt <rostedt@goodmis.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Nathan Chancellor <nathan@kernel.org>,
Kees Cook <kees@kernel.org>, Jann Horn <jannh@google.com>,
Bart Van Assche <bvanassche@acm.org>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Subject: [PATCH v2 3/4] ww-mutex: Fix the ww_acquire_ctx function annotations
Date: Wed, 25 Feb 2026 10:32:43 -0800 [thread overview]
Message-ID: <20260225183244.4035378-4-bvanassche@acm.org> (raw)
In-Reply-To: <20260225183244.4035378-1-bvanassche@acm.org>
The ww_acquire_done() call is optional. Reflect this in the annotations of
ww_acquire_done().
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Fixes: 47907461e4f6 ("locking/ww_mutex: Support Clang's context analysis")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
include/linux/ww_mutex.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/ww_mutex.h b/include/linux/ww_mutex.h
index 85b1fff02fde..0c95ead5a297 100644
--- a/include/linux/ww_mutex.h
+++ b/include/linux/ww_mutex.h
@@ -181,7 +181,7 @@ static inline void ww_acquire_init(struct ww_acquire_ctx *ctx,
* data structures.
*/
static inline void ww_acquire_done(struct ww_acquire_ctx *ctx)
- __releases(ctx) __acquires_shared(ctx) __no_context_analysis
+ __must_hold(ctx)
{
#ifdef DEBUG_WW_MUTEXES
lockdep_assert_held(ctx);
@@ -199,7 +199,7 @@ static inline void ww_acquire_done(struct ww_acquire_ctx *ctx)
* mutexes have been released with ww_mutex_unlock.
*/
static inline void ww_acquire_fini(struct ww_acquire_ctx *ctx)
- __releases_shared(ctx) __no_context_analysis
+ __releases(ctx) __no_context_analysis
{
#ifdef CONFIG_DEBUG_LOCK_ALLOC
mutex_release(&ctx->first_lock_dep_map, _THIS_IP_);
next prev parent reply other threads:[~2026-02-25 18:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 18:32 [PATCH v2 0/4] Lock context annotation fixes Bart Van Assche
2026-02-25 18:32 ` [PATCH v2 1/4] locking: Fix rwlock and spinlock lock context annotations Bart Van Assche
2026-02-28 10:56 ` [tip: locking/core] " tip-bot2 for Bart Van Assche
2026-03-12 16:36 ` Bart Van Assche
2026-02-25 18:32 ` [PATCH v2 2/4] signal: Fix the lock_task_sighand() annotation Bart Van Assche
2026-02-28 10:56 ` [tip: locking/core] " tip-bot2 for Bart Van Assche
2026-02-25 18:32 ` Bart Van Assche [this message]
2026-02-28 10:56 ` [tip: locking/core] ww-mutex: Fix the ww_acquire_ctx function annotations tip-bot2 for Bart Van Assche
2026-02-25 18:32 ` [PATCH v2 4/4] Revert "lockdep: Annotate lockdep assertions for context analysis" Bart Van Assche
2026-02-25 18:40 ` Marco Elver
2026-02-25 19:22 ` Marco Elver
2026-02-25 19:27 ` Bart Van Assche
2026-02-25 18:44 ` [PATCH v2 0/4] Lock context annotation fixes Marco Elver
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=20260225183244.4035378-4-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=boqun@kernel.org \
--cc=elver@google.com \
--cc=hch@lst.de \
--cc=jannh@google.com \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mingo@redhat.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.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 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®