From nobody Mon Apr 6 19:59:39 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 972FE376471; Wed, 18 Mar 2026 08:02:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773820972; cv=none; b=VuSVSDL+HKfFdJ9T1CEKzgilt2FjGy36aa3XydI++cIv5mxV7LtiRCBRynR9UiPVJr4J8qRl+CqmzE+54s9uFnllePvtqv20sJVVfubu8VLE+YNCIxjLKkCxUX+c4kIuvRJ87TVQFRLFPptSzxlcW5eNwtBsuqoBUHWFkHqLCxo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773820972; c=relaxed/simple; bh=AdCDmrx3PAyjAoj1ddV0SfY4N2vs0ElLaNHxOhbxcM4=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=YxGJJrlBaNud63BCBAWj7ChqGNyZEDECpyDGR/RPdGGiLW70hyHeBus9INBiSCqPRY8+MkqujE40hcTBMvA7iCiJFCBnBJcv41vMGtPmDyT5/vqA5ue6UNYYgzpLsj7CUmGatjPTzKsuP/jRJsMLhkH+ltDaHE3ZE1R8H1AI4gY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=4mHetdO8; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=skkmQS12; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="4mHetdO8"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="skkmQS12" Date: Wed, 18 Mar 2026 08:02:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1773820968; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rct8izpNS6ISQwW0lBXo69/gL5Lb/pMMr6MmixBnSu8=; b=4mHetdO8P37Ve3Eqen0AXLPttcJcMBLruNtVNrZjYk72Mm/NZ+/oAtu7gOOogRIatOZf9M jB50+n8L070f3HG1XyPFEDWlZ1Skxi5HEI6OLwTf9cgtX1xObns/Kz0+ASGnS6/7ASwoJA 1OKFeigFojTL189WC9kEeHo2Rn0M2BTq4XMRTSOccTW0bLOS/qeTJAYoaooqAapK4gLZbM Dz3d+KUJ013fs6ByRtWzxS6DCbRfH2eV6Lu5YL1cPX86MSDDn4ed6fl2TTg/EZrOffLnjk 1ynzf86haQgoup/aSgRbTOzhSgwRySbZysFH/OuOuOkgs1MTEyYsS1IAanmOGw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1773820968; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rct8izpNS6ISQwW0lBXo69/gL5Lb/pMMr6MmixBnSu8=; b=skkmQS12/GOmtRqp4aPrFjmprlvQ0jQx7HxnmtqyXBb4xL45DPqDXkY/hUSgiqod78mPsD Nc5P2F+vf7aQrsCA== From: "tip-bot2 for Bart Van Assche" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/core] locking: Add lock context support in do_raw_{read,write}_trylock() Cc: Bart Van Assche , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260313171510.230998-3-bvanassche@acm.org> References: <20260313171510.230998-3-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177382096737.1647592.8230498500951976614.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the locking/core branch of tip: Commit-ID: c4d3b8c77d85082d32250c505beb1d9e46ee47ee Gitweb: https://git.kernel.org/tip/c4d3b8c77d85082d32250c505beb1d9e4= 6ee47ee Author: Bart Van Assche AuthorDate: Fri, 13 Mar 2026 10:15:08 -07:00 Committer: Peter Zijlstra CommitterDate: Mon, 16 Mar 2026 13:16:50 +01:00 locking: Add lock context support in do_raw_{read,write}_trylock() Convert do_raw_{read,write}_trylock() from macros into inline functions and annotate these inline functions with __cond_acquires_shared() or __cond_acquires() as appropriate. This change is necessary to build kernel drivers or subsystems that use rwlock synchronization objects with lock context analysis enabled. The return type 'int' matches the return type for CONFIG_DEBUG_SPINLOCK=3Dy. Signed-off-by: Bart Van Assche Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20260313171510.230998-3-bvanassche@acm.org --- include/linux/rwlock.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/linux/rwlock.h b/include/linux/rwlock.h index 21ceefc..4e67cd9 100644 --- a/include/linux/rwlock.h +++ b/include/linux/rwlock.h @@ -37,10 +37,20 @@ extern int do_raw_write_trylock(rwlock_t *lock) __cond_= acquires(true, lock); extern void do_raw_write_unlock(rwlock_t *lock) __releases(lock); #else # define do_raw_read_lock(rwlock) do {__acquire_shared(lock); arch_read_lo= ck(&(rwlock)->raw_lock); } while (0) -# define do_raw_read_trylock(rwlock) arch_read_trylock(&(rwlock)->raw_lock) +static inline int do_raw_read_trylock(rwlock_t *rwlock) + __cond_acquires_shared(true, rwlock) + __no_context_analysis +{ + return arch_read_trylock(&(rwlock)->raw_lock); +} # define do_raw_read_unlock(rwlock) do {arch_read_unlock(&(rwlock)->raw_lo= ck); __release_shared(lock); } while (0) # define do_raw_write_lock(rwlock) do {__acquire(lock); arch_write_lock(&(= rwlock)->raw_lock); } while (0) -# define do_raw_write_trylock(rwlock) arch_write_trylock(&(rwlock)->raw_lo= ck) +static inline int do_raw_write_trylock(rwlock_t *rwlock) + __cond_acquires(true, rwlock) + __no_context_analysis +{ + return arch_write_trylock(&(rwlock)->raw_lock); +} # define do_raw_write_unlock(rwlock) do {arch_write_unlock(&(rwlock)->raw_= lock); __release(lock); } while (0) #endif =20