From patchwork Fri Jan 13 12:31:14 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: 43261 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp244459wrt; Fri, 13 Jan 2023 04:38:13 -0800 (PST) X-Google-Smtp-Source: AMrXdXtJCI8n7FJHm4kwqiw6Jm4ISltSWAc0r+VqaKZrgBx/v0Q5zd6O1vbcXsPhLJ/akUsFoqIl X-Received: by 2002:a05:6402:e81:b0:48c:afae:9331 with SMTP id h1-20020a0564020e8100b0048cafae9331mr42643936eda.10.1673613493243; Fri, 13 Jan 2023 04:38:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673613493; cv=none; d=google.com; s=arc-20160816; b=cmRticf2uGzZw103FfWXZZRMxldMzXcjrUiso9+rKuUUiiIrceLZOIqoclZ3Wnyk+l emqDGjGaRQcliZ1MxThiuGcb3NlqVFBE4eNZZSc5qU3hdgvP/NUcY4Zp1N9M0Uvv1Wt8 QC5Sr3wikNvqTx7ILwr7badxM6Y31zvM+hOWvJoV+qe5n2KV9g7kqH50AA8i+l8/FP/f vkxNuOceFCVzMt6oEPjQ62t8DxpItcoYOImnn1ms/JNsrExQRVzhXzRUeoQsOYCHCGvJ /FJX4qEaET4TAwbINNlJQx+h0FW482NWFxbTGvfVvL41NiPNhbMJ1C2FkABwB29Tmzxc le6Q== 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=x0cZZAZSTrqYu0gbJNkXuBSXWsztONJlo8KvNyVa3IA=; b=jp6CNqLCwF2jXIs1yO+YIAfUzTfgMZ/H9rDFoHuPo8gVnGT2n6NiJvZW052M47rbZs ZCmvlnETvhqs/aAKHz1xF/CWm06YGc4PmrJTAvCmbzoxMy1qCta03Z2xwcAIAWwAyPZT IJ1irzGdP1LwdkOpjzvfVnqD6xHT39Mf8fdeeCwGWEXgXgFkHpDZpvRsGA3bUxz/zjhj r4KnkYR1Oq1rCuZVxb5LWdJ5aD5PdKQvojDC1RcMt8vcw/yv4hEdLPLAU9v2GGGDkH14 dPRxN6gPSFrUq2NKCmcS4N2vLzFTovCH/soEaLa7M3XXwU3Qy4eptPwT58d2leQPtf8c 8j5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=p4+li1LE; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 m14-20020a056402510e00b004876785ef7esi9812369edd.489.2023.01.13.04.37.49; Fri, 13 Jan 2023 04:38:13 -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=p4+li1LE; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 S241717AbjAMMgn (ORCPT + 99 others); Fri, 13 Jan 2023 07:36:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241096AbjAMMcT (ORCPT ); Fri, 13 Jan 2023 07:32:19 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A8C256898; Fri, 13 Jan 2023 04:31:16 -0800 (PST) Date: Fri, 13 Jan 2023 12:31:14 -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=x0cZZAZSTrqYu0gbJNkXuBSXWsztONJlo8KvNyVa3IA=; b=p4+li1LEpTK6di04MspXLaS+evvgPOFXIEJ4NmPEfde5rR2NwdskBUBWAXZrvGZs4XHA78 /qMnNtMzn67srgijzPmQgrMU+YBu5qwSem6h76RUXKN0d34Q+og+PyQcGxzyEXB+R0NR6x RmW74Ck4vv6LH9GlF58Gub20XlBd//TcvMOjta9DPNF/9DhPjppZv8r2MoG7Xi39zDfO2n 8ybFylmpQtgkVezUZLMam8dZTMOE4kIhOVGl+WfoaE+NUcVporAsEWwaRtqm6Oy3jo+QKu lYQMAuM2bQgc7a+7T0QlN6D92HEwDcAnxe5JmZ1sr6x8xzoDswylDCJwoWrJgA== 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=x0cZZAZSTrqYu0gbJNkXuBSXWsztONJlo8KvNyVa3IA=; b=68AIeLujAN0bManKfxRWaakf0npl3p/e71LahqWOoRlOvAwTr/eT57b9vRrYm6LhqehCHo nlelKQCaj103BxAg== 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, psci: Push RCU-idle into driver Cc: "Peter Zijlstra (Intel)" , Ingo Molnar , Kajetan Puchalski , Tony Lindgren , Ulf Hansson , Frederic Weisbecker , Guo Ren , "Rafael J. Wysocki" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230112195539.760296658@infradead.org> References: <20230112195539.760296658@infradead.org> MIME-Version: 1.0 Message-ID: <167361307481.4906.6468882883967767760.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?1754848584651084356?= X-GMAIL-MSGID: =?utf-8?q?1754910941807930718?= The following commit has been merged into the sched/core branch of tip: Commit-ID: e038f7b8028a1d1bc8ac82351c71ea538f19a879 Gitweb: https://git.kernel.org/tip/e038f7b8028a1d1bc8ac82351c71ea538f19a879 Author: Peter Zijlstra AuthorDate: Thu, 12 Jan 2023 20:43:21 +01:00 Committer: Ingo Molnar CommitterDate: Fri, 13 Jan 2023 11:03:22 +01:00 cpuidle, psci: 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. Notably 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: Kajetan Puchalski Tested-by: Tony Lindgren Tested-by: Ulf Hansson Reviewed-by: Frederic Weisbecker Reviewed-by: Guo Ren Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20230112195539.760296658@infradead.org --- drivers/cpuidle/cpuidle-psci.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/cpuidle/cpuidle-psci.c b/drivers/cpuidle/cpuidle-psci.c index 57bc3e3..969808c 100644 --- a/drivers/cpuidle/cpuidle-psci.c +++ b/drivers/cpuidle/cpuidle-psci.c @@ -69,12 +69,12 @@ static int __psci_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(); state = psci_get_domain_state(); if (!state) @@ -82,12 +82,12 @@ static int __psci_enter_domain_idle_state(struct cpuidle_device *dev, ret = psci_cpu_suspend_enter(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(); @@ -240,6 +240,7 @@ static int psci_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 = psci_enter_domain_idle_state; drv->states[state_count - 1].enter_s2idle = psci_enter_s2idle_domain_idle_state; psci_cpuidle_use_cpuhp = true;