From patchwork Fri Jan 13 12:31:15 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: 43265 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp244625wrt; Fri, 13 Jan 2023 04:38:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXtbgHQzIGmjULniQ9oNzIB+fNkEA+DTpqH2ZBRRd5mAJnT3DGJo2xWp/er8cUEBuoWJFsTu X-Received: by 2002:aa7:d1c8:0:b0:49b:7416:e3fc with SMTP id g8-20020aa7d1c8000000b0049b7416e3fcmr4881765edp.36.1673613518291; Fri, 13 Jan 2023 04:38:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673613518; cv=none; d=google.com; s=arc-20160816; b=fKNv0xH8s0YgUuwVGtUPJ16t3XQP83Dcm68e+5jPzYbxGPHCVrDSLodhC0XBP8IoGD sN58KpD7riuKRwksaIpufOcJye9oz6Wt6peCJ5Q+6iUUoM1Pl/CtVoerfsIqvk8yqdRk L49fKmDhqMrjrw2Ms+iYSE3Py+548/c7dzN9OkUMgVx7iFe5PrVdy/frtozyAWziX0pm wMgUdi87iDVvsEUkpkoubhmmqplKSXfdLKEyFBGpki0Qp00CObX3wo96fwYBtI3f8uys XwC4qDGVIARTC4ZiNe/S5oLhirQ3IIGOwoyJDZ4XTtlTH2fPXNUZq6RnXtpAmLbKt2Iq tv8g== 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=/oyZgvO33ZtyKUfO22o+/oe9NkApuzXcK0D+XIHMSFg=; b=yoX3kcTPKoMcz1eDirfbI31nrGFzxtU6xeFf1skpAZsaUbXmUGx8jWHL6w5PHHB9iV jm84d9QCzfWIkTKKpXKrff0vB7aGfNGDzgeIQJUat8CRC/a+9c0WcximC39aPKjV6Fes MjtHAFcMRRgWdBWQO4B/edUY5YvDF4YI+eAae2Mc4SdyZZWBncWwber1u+AsjCZtLlp+ 4zbD5QJx8VraWjMIrG6j6R06H+ko4fl292fDalCKQ9BiiiQOUQS2HFwVXWmMLJni732e +ZucCtrZ6AX83rLRZAagUzjmK1FGEqh1CitnAqtKQeQBgOheTNHs50ZJ0a26w5YMGGWZ eT6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=EYsMOvwn; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Y2jE269C; 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 q33-20020a05640224a100b0049d10e17d69si255476eda.429.2023.01.13.04.38.13; Fri, 13 Jan 2023 04:38:38 -0800 (PST) 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=EYsMOvwn; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Y2jE269C; 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 S241486AbjAMMhJ (ORCPT + 99 others); Fri, 13 Jan 2023 07:37:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240802AbjAMMcU (ORCPT ); Fri, 13 Jan 2023 07:32:20 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D126A574C5; Fri, 13 Jan 2023 04:31:16 -0800 (PST) Date: Fri, 13 Jan 2023 12:31:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1673613075; 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=/oyZgvO33ZtyKUfO22o+/oe9NkApuzXcK0D+XIHMSFg=; b=EYsMOvwnSZrkdiBLaho7e+R0+u2451f0UwPaQOjG2XcXZmq99Wt2XDeYPcGJ9+gEgNGqjp snnav7Rkjp7czRlnFjInWLvCEOyM2gIj5LtXbzLXTrkfhZ64ADW35avLPrstLXDb3gDPxX K3N8Z5HVHeB/rXQ1k4o7UWiLilr/LV1fN3fShkHvTkf7NFTC9ZouHIEIwp2Gab4ayvitSa m1VD98Cnp2pO8DAdwpV8XBaB5Xi18q2Lv8BZSZjL32hv6camNDd7cGc55QrM1ElrC5hwDb K+tn6Bf9jNFuYo+eH7f0wG6e4+h13eJZpHHXoXhbYTqq5CDH74VoCreM5NoBQA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1673613075; 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=/oyZgvO33ZtyKUfO22o+/oe9NkApuzXcK0D+XIHMSFg=; b=Y2jE269CGToUVClMFXekdPdvzQrpzJF8TjlMYMb6Nt6D2VmizuhoeGSKLsmAnrevrFTUq3 CjSuHgBSP5LmnHAg== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] cpuidle, riscv: Push RCU-idle into driver Cc: "Peter Zijlstra (Intel)" , Ingo Molnar , Tony Lindgren , Ulf Hansson , Anup Patel , Frederic Weisbecker , "Rafael J. Wysocki" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230112195539.637185846@infradead.org> References: <20230112195539.637185846@infradead.org> MIME-Version: 1.0 Message-ID: <167361307515.4906.5088931102976542675.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 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?1754848510663993539?= X-GMAIL-MSGID: =?utf-8?q?1754910968217242385?= The following commit has been merged into the sched/core branch of tip: Commit-ID: 8e9ab9e8da1eae61fdff35690d998eaf8cd527dc Gitweb: https://git.kernel.org/tip/8e9ab9e8da1eae61fdff35690d998eaf8cd527dc Author: Peter Zijlstra AuthorDate: Thu, 12 Jan 2023 20:43:19 +01:00 Committer: Ingo Molnar CommitterDate: Fri, 13 Jan 2023 11:03:22 +01:00 cpuidle, riscv: Push RCU-idle into driver Doing RCU-idle outside the driver, only to then temporarily enable it again, at least twice, before going idle is suboptimal. That is, once implicitly through the cpu_pm_*() calls and once explicitly doing ct_irq_*_irqon(). Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Tested-by: Tony Lindgren Tested-by: Ulf Hansson Reviewed-by: Anup Patel Reviewed-by: Frederic Weisbecker Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20230112195539.637185846@infradead.org --- drivers/cpuidle/cpuidle-riscv-sbi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/cpuidle/cpuidle-riscv-sbi.c b/drivers/cpuidle/cpuidle-riscv-sbi.c index 05fe290..cbdbb11 100644 --- a/drivers/cpuidle/cpuidle-riscv-sbi.c +++ b/drivers/cpuidle/cpuidle-riscv-sbi.c @@ -121,12 +121,12 @@ static int __sbi_enter_domain_idle_state(struct cpuidle_device *dev, return -1; /* Do runtime PM to manage a hierarchical CPU toplogy. */ - ct_irq_enter_irqson(); if (s2idle) dev_pm_genpd_suspend(pd_dev); else pm_runtime_put_sync_suspend(pd_dev); - ct_irq_exit_irqson(); + + ct_idle_enter(); if (sbi_is_domain_state_available()) state = sbi_get_domain_state(); @@ -135,12 +135,12 @@ static int __sbi_enter_domain_idle_state(struct cpuidle_device *dev, ret = sbi_suspend(state) ? -1 : idx; - ct_irq_enter_irqson(); + ct_idle_exit(); + if (s2idle) dev_pm_genpd_resume(pd_dev); else pm_runtime_get_sync(pd_dev); - ct_irq_exit_irqson(); cpu_pm_exit(); @@ -251,6 +251,7 @@ static int sbi_dt_cpu_init_topology(struct cpuidle_driver *drv, * of a shared state for the domain, assumes the domain states are all * deeper states. */ + drv->states[state_count - 1].flags |= CPUIDLE_FLAG_RCU_IDLE; drv->states[state_count - 1].enter = sbi_enter_domain_idle_state; drv->states[state_count - 1].enter_s2idle = sbi_enter_s2idle_domain_idle_state;