From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from 011.lax.mailroute.net (011.lax.mailroute.net [199.89.1.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 943743ED126 for ; Wed, 25 Feb 2026 18:33:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772044396; cv=none; b=luJwsKGXRsXiL5rYXa+I+Fy+aFhh4budEUq/NMOaKfd/GAlpS65A0sGq4JNxNGoN9GMuGyGHP78Gimee3i6qmjpdEDKtl00fPiXjc4cx51kkG0UmIuN5U2o4ia55zAC94OUMvdZ4AT9X02uMHYaWts3qRKHWZyMz/eO/+NS9Ydo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772044396; c=relaxed/simple; bh=bVc8/yuQKV9ZGwPf1skKx7qKYQwCrbEuzZfPlLKdW50=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I1bkdEppLXeiFpH//XgRIflRu7PhacltLroESnaHDsubVMc9dmdLBtECm0bOFZIECmEKKheDd3fQUiiapPT2JaNapVfD8IwpwxwpJpuc89flioo2rw/SSTuwKuCyU2yn+zFOKyP2ocGK8eHM3rT004bwNNLkrFShrGUruGEnBtY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=L/MMCT7i; arc=none smtp.client-ip=199.89.1.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="L/MMCT7i" Received: from localhost (localhost [127.0.0.1]) by 011.lax.mailroute.net (Postfix) with ESMTP id 4fLjrq2GhVz1XM0nk; Wed, 25 Feb 2026 18:33:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1772044392; x=1774636393; bh=AGA+j aypXAgRXpOJm/1iaZK05pDP/k1iT1kI0HMoyew=; b=L/MMCT7i/ANeKRqhRw2q2 MwtEw6ovyMFZIDosglNqOr6nfjvRmUZEUl9FVL98GmNFNAqSFNgjjoQhLGB5Q36J m3vIX+9j9f0ssJuRA9wduPKJucXdoqeVxBO99Q4RfHgCKexzWbXvDczmeJsF8dxp oO+kM17nmfpvZShHjFuEqLe/bl0A0lItEWKcweTR7EETLSVuSdZ8OI5EoSYUAJBH 1a0AXu1/LweJD25yfHxvXSzIRXL0OkDH7AjyBGXO3jnWapXLdW/DyKushrxaJpwZ w2UqGKOcVwDA87bTp6Y5OLpoP4X1fuwXC1LY9oqkoR03F8PwIXFbMNQXjhLshu5H Q== X-Virus-Scanned: by MailRoute Received: from 011.lax.mailroute.net ([127.0.0.1]) by localhost (011.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id wIypbyyZm6LL; Wed, 25 Feb 2026 18:33:12 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.180.219]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 011.lax.mailroute.net (Postfix) with ESMTPSA id 4fLjrj0Jmxz1XM6J5; Wed, 25 Feb 2026 18:33:08 +0000 (UTC) From: Bart Van Assche To: Peter Zijlstra Cc: Ingo Molnar , Will Deacon , Boqun Feng , Waiman Long , linux-kernel@vger.kernel.org, Marco Elver , Christoph Hellwig , Steven Rostedt , Nick Desaulniers , Nathan Chancellor , Kees Cook , Jann Horn , Bart Van Assche , Maarten Lankhorst Subject: [PATCH v2 3/4] ww-mutex: Fix the ww_acquire_ctx function annotations Date: Wed, 25 Feb 2026 10:32:43 -0800 Message-ID: <20260225183244.4035378-4-bvanassche@acm.org> X-Mailer: git-send-email 2.53.0.414.gf7e9f6c205-goog In-Reply-To: <20260225183244.4035378-1-bvanassche@acm.org> References: <20260225183244.4035378-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable The ww_acquire_done() call is optional. Reflect this in the annotations o= f ww_acquire_done(). Acked-by: Maarten Lankhorst Fixes: 47907461e4f6 ("locking/ww_mutex: Support Clang's context analysis"= ) Signed-off-by: Bart Van Assche --- 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_);