From nobody Mon Feb 9 11:28:18 2026 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A5D93491DE for ; Fri, 19 Dec 2025 15:46:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766159192; cv=none; b=FjufyXjVx9jAtPN0zlGlVZBDAnLqJf9o4a08JOW/oplZyJf8Yd252I9l/jFGgdWX/CTEQEPiHFRMm+ytc8uHb2yovNlZ/a0Urgig3xQJxbPv9uIhnwQgPnrOmEwjARNYCipjz1lL6wn7SgpFpYLtVInK2da2eFjrrQL+s/TtZ8c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766159192; c=relaxed/simple; bh=+TxyiziKtAssraZX/W9BG58Rc5SRTSVNFHhEJgAI80M=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Yc0rK0deRYlRZjfl77B3nN9/6OBm8pFg0C7Zp/w+/V55Nn5A7QAobRgegPG3mDNh4EZcqWYsQ1A4J3au7RyUKVkP/CB38I9iK/ENJsLQAu40HLF81IdiOm4a9So/t8V/rCQx5vKTRsFo+IEjswARSN8sqCdpKNOVwBGrzZq9yww= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--elver.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Btmm9Ian; arc=none smtp.client-ip=209.85.128.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--elver.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Btmm9Ian" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-477cf25ceccso19115785e9.0 for ; Fri, 19 Dec 2025 07:46:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1766159189; x=1766763989; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=JNejWFdtMyTjodgPbCP3MYwy/kg9I0zeQniFTuJdWnY=; b=Btmm9Ian9vkW2R1CmBw+4UEGFIcU19VTH1if1ZDzBv6i7+qkwK8FB/mchliyLeX7ea Lv3TTAaSEl6CyhgCR+GVo+O385fSiZ8SbrQyzBZqEUR/rpjDaMx/DKaQMGqWRGMwYmbI su6Lg1c7UP1tDmGTlM0gi4ZPnBCuLD2W78C8eggo3adVNqKxuLE9wxwaDVyiBk4InD+D PrPKasVfuRx8a41HcrByYZw3oCLNoOkUIIxynFHot93y8oFhIBAnXnNbxjmB4ldktlKr eQz8DC14OOMXKZswgtZN8/umOcDiIYb/xDa6S8yC6KraIgzXaB9Dq52KnlM6o/q4Igwo TKZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766159189; x=1766763989; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JNejWFdtMyTjodgPbCP3MYwy/kg9I0zeQniFTuJdWnY=; b=tB1fF4Ih4I6oTJ5M2tmndTa0TAOfLrNdx81KvnMDWpiBiDY4LXIKSsDBmxC5OQxiMG ndKHNt2ZK+Pb3nMVi34Ym8MU1OoRW1Owb+6ReCXfPL0/A7mRS0T0UniHqkkUQyX+1LcP IlAmu6zgKsKtlvr/8aefLMX0YqHjcKY+9ZyiGC73k2+9QEHmBxNhgOulrGjm8u47z2PI N99vJPId27AXRFghZpPyTMHVO/ef1ceeyIRfqYltTRPXteyLQmTZJrTOlFckZ1JKYWX6 IE4DgFDdy42tFRjVR5zM80YKEbnwONJ0PHzCtPRXjJB+kSnmvv6hEWGmZ82zez9dDvCb or8g== X-Forwarded-Encrypted: i=1; AJvYcCWEdgKuxGdlYs0HRveVhC0QGgYvxu3PdawckrvDjTOkHQQ6kprZUBb/VRYY+rl+XCyLhqBWuv6vfSUr0e4=@vger.kernel.org X-Gm-Message-State: AOJu0YzhIyQfPGsyF9DXxDTp85WszDjBirpLLJ2J3Z+hP6Y0uQx1M8vc S/AQoO+bZVRyO0lgwLmqtNeA9nawi1B6ECDc3efmWf7+ogBStlA50moSMAshkNPcqinEs+xqyIX N1w== X-Google-Smtp-Source: AGHT+IFZPg350on31b7Arj7YO65031V0YGnmFoBhddxYq3gtipYJLlSpx9LZ4+YgVEePmezOZITENNcOhw== X-Received: from wmbdr22.prod.google.com ([2002:a05:600c:6096:b0:477:7949:c534]) (user=elver job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:820d:b0:479:3a87:208f with SMTP id 5b1f17b1804b1-47d195aa085mr30273655e9.36.1766159188650; Fri, 19 Dec 2025 07:46:28 -0800 (PST) Date: Fri, 19 Dec 2025 16:40:05 +0100 In-Reply-To: <20251219154418.3592607-1-elver@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251219154418.3592607-1-elver@google.com> X-Mailer: git-send-email 2.52.0.322.g1dd061c0dc-goog Message-ID: <20251219154418.3592607-17-elver@google.com> Subject: [PATCH v5 16/36] kref: Add context-analysis annotations From: Marco Elver To: elver@google.com, Peter Zijlstra , Boqun Feng , Ingo Molnar , Will Deacon Cc: "David S. Miller" , Luc Van Oostenryck , Chris Li , "Paul E. McKenney" , Alexander Potapenko , Arnd Bergmann , Bart Van Assche , Christoph Hellwig , Dmitry Vyukov , Eric Dumazet , Frederic Weisbecker , Greg Kroah-Hartman , Herbert Xu , Ian Rogers , Jann Horn , Joel Fernandes , Johannes Berg , Jonathan Corbet , Josh Triplett , Justin Stitt , Kees Cook , Kentaro Takeda , Lukas Bulwahn , Mark Rutland , Mathieu Desnoyers , Miguel Ojeda , Nathan Chancellor , Neeraj Upadhyay , Nick Desaulniers , Steven Rostedt , Tetsuo Handa , Thomas Gleixner , Thomas Graf , Uladzislau Rezki , Waiman Long , kasan-dev@googlegroups.com, linux-crypto@vger.kernel.org, linux-doc@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-security-module@vger.kernel.org, linux-sparse@vger.kernel.org, linux-wireless@vger.kernel.org, llvm@lists.linux.dev, rcu@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Mark functions that conditionally acquire the passed lock. Signed-off-by: Marco Elver Reviewed-by: Bart Van Assche --- include/linux/kref.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/kref.h b/include/linux/kref.h index 88e82ab1367c..9bc6abe57572 100644 --- a/include/linux/kref.h +++ b/include/linux/kref.h @@ -81,6 +81,7 @@ static inline int kref_put(struct kref *kref, void (*rele= ase)(struct kref *kref) static inline int kref_put_mutex(struct kref *kref, void (*release)(struct kref *kref), struct mutex *mutex) + __cond_acquires(true, mutex) { if (refcount_dec_and_mutex_lock(&kref->refcount, mutex)) { release(kref); @@ -102,6 +103,7 @@ static inline int kref_put_mutex(struct kref *kref, static inline int kref_put_lock(struct kref *kref, void (*release)(struct kref *kref), spinlock_t *lock) + __cond_acquires(true, lock) { if (refcount_dec_and_lock(&kref->refcount, lock)) { release(kref); --=20 2.52.0.322.g1dd061c0dc-goog