From patchwork Wed May 10 13:25:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 92092 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3628450vqo; Wed, 10 May 2023 06:35:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ayRLFiOzizj5d+qFWjr04IswLmQ3VzD0o+VDGKuzgLQ+2b5JOVrHavC6Zw6XCzcNnJyXX X-Received: by 2002:a17:902:a516:b0:1ab:1355:1a45 with SMTP id s22-20020a170902a51600b001ab13551a45mr17026827plq.30.1683725717292; Wed, 10 May 2023 06:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683725717; cv=none; d=google.com; s=arc-20160816; b=Zch8Jhll+uP3ftCTupOwWPukFh8yu7vcGwVo2d0Wmm0zasQVom+nAQ3b7VvjtwkIb+ Arw+jDGjwoAFdxv2UGP8cuMcka/A1PiYujLsUR3eXPCayVX/eIT7w6soKmAhadNg2wBy Lg2mxRgwrl0GLNXQRHdqSZX61/W/uGf0xZ6d+uZ9x8dn4iHvyg47njKNVqnXilrHBGwd Yjxs34KOZlwlDo6CYcQqxzJvingNCXCofDNLgO4ClOhOgD5ORkdW1k+ni3/bku1pIZ6M W9/SnhnprX9PY+SDR73/NhEzjcx09dMgz+j9lksGzRnMCSlpM/6X4dhiuv+p6l3grgMX YV6w== 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.s=2020e 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m9-20020a170902db0900b001aaf4d2eef6si4500093plx.370.2023.05.10.06.35.01; Wed, 10 May 2023 06:35:17 -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.s=2020e 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 S236989AbjEJNZ6 (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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764839368213526567?= X-GMAIL-MSGID: =?utf-8?q?1765514377874030644?= 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); }