From nobody Sun Feb 8 07:07:30 2026 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (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 DBD8A35CB9C for ; Tue, 3 Feb 2026 22:51:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770159085; cv=none; b=Ywm59Ur2/Gv/N0Sjdh6rCoUM7io9c20avt3xCJOGwHVpGc9SekKOMQhyAkZy6FjTvLTkMVnJRE3mD4tjRZ3V72B0vE4ayCo9I8KDeOrelUVed6xzn9izzZ0TS+fzSYSNbEJrpTFBDlEVccj2LI8eKLV6p4Go1BConTpYsZRPu6Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770159085; c=relaxed/simple; bh=Tn3E1o0KMAET7YN999fmQLSh3BVk3QZG/lROPQ88UFQ=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=bWx6VGedL9YbBxKE0d30XR6TMr2CC9x8QmHs4J+ancu9RQ8ncgaeBeWvAvSLbWEZHqkFJyHBn4lC/Uo/M21V2IbEmKkrmodrYc1+rR0k0kugwaexBGicoAK3ZAGktEkb3Wc2c1iuDa6HqCT8BrNqGLz7edsV4Tjxj6tqJVqFZeU= 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=LcB9SnMF; arc=none smtp.client-ip=209.85.128.74 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="LcB9SnMF" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-4806e7c4220so1258685e9.2 for ; Tue, 03 Feb 2026 14:51:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1770159082; x=1770763882; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=7V20sWlc5RVsh/o7j3H1tJ30NR6XAOQhuKL3Fnt3PF0=; b=LcB9SnMF01jeZTnW+09sHXUaVfeh3K3KaUe33VC70mo3677GbBxjxXwP7VJTcaFYnw 09aPWolnqJzWQ9PxzEmYx3b+/OyyGN+q/lGn6X0KBnyOe36v9Q9djP1K6fim5mb9WmeI XqyPCQc4He9xQVLd7FnfJ4Kxv3goKVUS5NtQh99ISwnS3Nb074G27k7DMpgrCgxysJwI rm+IuPV6Z1qA4RSyQTlS3448e9czA/i7NJ43EiRN8AX7PcCXT//h4ZH5E5zmTJjSQThC Jx0dICZoMVlgiEQBZqZhC3TyRc/WHc4UhGBZ59M0LxdfC4TYVKDxBo4/I23ydLtu2Fvg Pb5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770159082; x=1770763882; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=7V20sWlc5RVsh/o7j3H1tJ30NR6XAOQhuKL3Fnt3PF0=; b=TU+KzdOm5g1BnZKvy9ckKklLCgd5nGlW+3Q+xrYiGDShTvv4K4H4TCCzHf6dQ5sLtO CGt+zSTkKO3cmL6axRBNPvB5/pOwyvJIVg7IFEmPNr4DRm3GZY3n5eMn2/hL2zsIJjQH XiaFC/sJ2SFBBrhL0K/2K/RbrlT8hjMaQKDt/7eoObgEiajF+aEm47d+IcXlN/P5/DD/ bsMD45poBc9PXIk1R+2rbMd5q+gQf9kO6uAyZR9K3P8gkFa8pWO2n7g0cUB9crGTaQqG knMBoHPNFcZ0BPojgKu6ouxW2H6mvRFRNJ6ITW1W8FcI9u/ZHFad3Dn0KFazLX88nKVm p7tA== X-Forwarded-Encrypted: i=1; AJvYcCWQLColuogMp2GDHQCJUlmQ5EvMkJNqP/ZY80La54KQo15MDau9ZwhQXihfvrNsNTkgm9AGNvkZ3VyzPuM=@vger.kernel.org X-Gm-Message-State: AOJu0Yz3xYvRgNA3NKIJKH1hYzOX4IpAll/8TDbq4W4uMul4NzXrxuEy eagQpH2WHPUVaL+Ix5/hpGR6P2JNH9R5xw6YI7FE3U72kV44CCJLw4SNSlx3qbPLA+4hDkOHTFQ oiQ== X-Received: from wmoo6.prod.google.com ([2002:a05:600d:106:b0:480:6ceb:eb1b]) (user=elver job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:46d3:b0:480:52fe:58f5 with SMTP id 5b1f17b1804b1-4830e98030dmr17591325e9.31.1770159082401; Tue, 03 Feb 2026 14:51:22 -0800 (PST) Date: Tue, 3 Feb 2026 23:50:10 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.53.0.rc2.204.g2597b5adb4-goog Message-ID: <20260203225114.3493538-1-elver@google.com> Subject: [PATCH tip/locking/core] locking/rwlock: Fix write_trylock_irqsave() with CONFIG_INLINE_WRITE_TRYLOCK From: Marco Elver To: elver@google.com, Peter Zijlstra Cc: Ingo Molnar , Thomas Gleixner , Will Deacon , Boqun Feng , Waiman Long , Bart Van Assche , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, kernel test robot Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Move _raw_write_trylock_irqsave() after the _raw_write_trylock macro to ensure it uses the inlined version, fixing a linker error when inlining is enabled. This is the case on s390: >> ld.lld: error: undefined symbol: _raw_write_trylock >>> referenced by rwlock_api_smp.h:48 (include/linux/rwlock_api_smp.h:48) >>> lib/test_context-analysis.o:(test_write_trylock_extra)= in archive vmlinux.a >>> referenced by rwlock_api_smp.h:48 (include/linux/rwlock_api_smp.h:48) >>> lib/test_context-analysis.o:(test_write_trylock_extra)= in archive vmlinux.a Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202602032101.dbxRfsWO-lkp@int= el.com/ Signed-off-by: Marco Elver Reviewed-by: Bart Van Assche --- include/linux/rwlock_api_smp.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/linux/rwlock_api_smp.h b/include/linux/rwlock_api_smp.h index d903b17c46ca..61a852609eab 100644 --- a/include/linux/rwlock_api_smp.h +++ b/include/linux/rwlock_api_smp.h @@ -41,16 +41,6 @@ void __lockfunc _raw_write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) __releases(lock); =20 -static inline bool _raw_write_trylock_irqsave(rwlock_t *lock, unsigned lon= g *flags) - __cond_acquires(true, lock) -{ - local_irq_save(*flags); - if (_raw_write_trylock(lock)) - return true; - local_irq_restore(*flags); - return false; -} - #ifdef CONFIG_INLINE_READ_LOCK #define _raw_read_lock(lock) __raw_read_lock(lock) #endif @@ -147,6 +137,16 @@ static inline int __raw_write_trylock(rwlock_t *lock) return 0; } =20 +static inline bool _raw_write_trylock_irqsave(rwlock_t *lock, unsigned lon= g *flags) + __cond_acquires(true, lock) __no_context_analysis +{ + local_irq_save(*flags); + if (_raw_write_trylock(lock)) + return true; + local_irq_restore(*flags); + return false; +} + /* * If lockdep is enabled then we use the non-preemption spin-ops * even on CONFIG_PREEMPT, because lockdep assumes that interrupts are --=20 2.53.0.rc2.204.g2597b5adb4-goog