Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7302695rwr; Wed, 10 May 2023 06:41:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5M6GyWKGXp4HjQwU6JVFc6A1RChjBiCqzBJdGNwktgWIlydNQrQBW87519MBgyWL1gIy7G X-Received: by 2002:a05:6a20:428e:b0:101:4d10:e406 with SMTP id o14-20020a056a20428e00b001014d10e406mr7893345pzj.16.1683726073702; Wed, 10 May 2023 06:41:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683726073; cv=none; d=google.com; s=arc-20160816; b=qTqGAp8C6B1ZU49Xma9tbdrdwoCXrfBiklNqwddTNPWlVlng0Tfnh0ag/5JBzlWMj/ QNi0YJFFVUo8ZocH5Mlm7bETPIOwyvY1bKFFHKsm5lVEAHMMYSajOGOSfXBet0mCdyes YYOTT7dRwJErzsM5Mc6HPwV2Z9g/AVpjtuNpRYX1QqxbhAYClUb9spC2Caebgjs5/Dnz 1rFRkISikJG6g5Ga+JI9hqEjxBWy5Ayt+COaUp+M1zryXGxidtenIetZpNjl9CtyGmNc BM3+yBlPs1RTdJd8MhxtdkAiNVhiLAyyKT95QT1fswuiPTguaXo4fKo7rODFWxNCDsCI uNhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=9M+nf6U/P/tUi5DBkLwJC4aUssS4FE6HYCt3SW4Jmd8=; b=anTvSf4+dPWIseg+Kd5pBmYCXDIbL4gdWgEW5FfiDFCMbAhjg7AdUNfGMySOLhYWDB Ii+t2blTgW1m7uqDy1tHgoKlB/cYzTZ0NmZXa+zDv9lh65XoAror20Na8VHnM4kKEZsQ 4BMnC9zTbERbzTPmTSmQx6dQeDyCFJIr/jui1bTXtI1RxqSQ9cPQyaISSGnUGKS0c7zI 7nmpG12Uwq57l8j5ufPYMxGZJWhwwaxzh8XKA+dh2WUDyA1IyoS4mbisxNkNtj1I1h/v bUZo+6FL7RWwwzNQT/0W5e3H4JPkeJEVhrk/u3oyQRMp4e47GErb6Gsa8CFlrWUx4h+L EG1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="Bas0f/6u"; dkim=neutral (no key) header.i=@linutronix.de header.b=arfrKUKu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w12-20020a63934c000000b0051ae6c4084dsi3779614pgm.512.2023.05.10.06.40.59; Wed, 10 May 2023 06:41:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="Bas0f/6u"; dkim=neutral (no key) header.i=@linutronix.de header.b=arfrKUKu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236946AbjEJNZ6 (ORCPT + 99 others); Wed, 10 May 2023 09:25:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236652AbjEJNZ5 (ORCPT ); Wed, 10 May 2023 09:25:57 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77C775BAE; Wed, 10 May 2023 06:25:55 -0700 (PDT) Date: Wed, 10 May 2023 13:25:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1683725152; 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=9M+nf6U/P/tUi5DBkLwJC4aUssS4FE6HYCt3SW4Jmd8=; b=Bas0f/6u5hhtyYakWKF11FdpYb+JIqlbHy0mYSqaMZBN+v0uoTVXbjsxojji0IKF99UBwI TZdJvw8HTyMjfQxJztens8gjbp+GiiEcDfxT8JFD/gytyv6Van7Xc0XAqpzrbDnG9UOn6q UcjS1ytBEpg+DG+NQqojbzZuPv/GEnFwxfXSyhtCmP0C/xGzXk1vM/qUECn5qGv7kpKHfI 2PwcSTHvdvd7YcnknMO28l34E5q7bOeLuIt4UzCTPi+a+YFVlukaAdZRAT9duUzaB8aokD v+xmfPRbvxWxrIh+4NtlZ18tMUPH29YwcEdq38HbfduBYO3vxKbaFttenC3xxQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1683725152; 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=9M+nf6U/P/tUi5DBkLwJC4aUssS4FE6HYCt3SW4Jmd8=; b=arfrKUKunBDqCYqAvI4ZAwZb3s+HPhVN9XvULsPvu3ABnDWTrtQ8BSQMjA7SQxSwjjTs/8 Rj5iPWYO9WYnBgDg== From: "tip-bot2 for John Stultz" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/urgent] locking/rwsem: Add __always_inline annotation to __down_read_common() and inlined callers Cc: Tim Murray , John Stultz , "Peter Zijlstra (Intel)" , Waiman Long , stable@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230503023351.2832796-1-jstultz@google.com> References: <20230503023351.2832796-1-jstultz@google.com> MIME-Version: 1.0 Message-ID: <168372515216.404.11878802112685684036.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the locking/urgent branch of tip: Commit-ID: 92cc5d00a431e96e5a49c0b97e5ad4fa7536bd4b Gitweb: https://git.kernel.org/tip/92cc5d00a431e96e5a49c0b97e5ad4fa7536bd4b Author: John Stultz AuthorDate: Wed, 03 May 2023 02:33:51 Committer: Peter Zijlstra CommitterDate: Mon, 08 May 2023 10:58:24 +02:00 locking/rwsem: Add __always_inline annotation to __down_read_common() and inlined callers Apparently despite it being marked inline, the compiler may not inline __down_read_common() which makes it difficult to identify the cause of lock contention, as the blocked function in traceevents will always be listed as __down_read_common(). So this patch adds __always_inline annotation to the common function (as well as the inlined helper callers) to force it to be inlined so the blocking function will be listed (via Wchan) in traceevents. Fixes: c995e638ccbb ("locking/rwsem: Fold __down_{read,write}*()") Reported-by: Tim Murray Signed-off-by: John Stultz Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Waiman Long Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20230503023351.2832796-1-jstultz@google.com --- kernel/locking/rwsem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c index acb5a50..9eabd58 100644 --- a/kernel/locking/rwsem.c +++ b/kernel/locking/rwsem.c @@ -1240,7 +1240,7 @@ static struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem) /* * lock for reading */ -static inline int __down_read_common(struct rw_semaphore *sem, int state) +static __always_inline int __down_read_common(struct rw_semaphore *sem, int state) { int ret = 0; long count; @@ -1258,17 +1258,17 @@ out: return ret; } -static inline void __down_read(struct rw_semaphore *sem) +static __always_inline void __down_read(struct rw_semaphore *sem) { __down_read_common(sem, TASK_UNINTERRUPTIBLE); } -static inline int __down_read_interruptible(struct rw_semaphore *sem) +static __always_inline int __down_read_interruptible(struct rw_semaphore *sem) { return __down_read_common(sem, TASK_INTERRUPTIBLE); } -static inline int __down_read_killable(struct rw_semaphore *sem) +static __always_inline int __down_read_killable(struct rw_semaphore *sem) { return __down_read_common(sem, TASK_KILLABLE); }