From nobody Sun Apr 5 20:03:33 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1196C54EBE for ; Fri, 13 Jan 2023 12:36:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241208AbjAMMgq (ORCPT ); Fri, 13 Jan 2023 07:36:46 -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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/core branch of tip: Commit-ID: e038f7b8028a1d1bc8ac82351c71ea538f19a879 Gitweb: https://git.kernel.org/tip/e038f7b8028a1d1bc8ac82351c71ea538= f19a879 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 cpuidl= e_device *dev, return -1; =20 /* 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(); =20 state =3D psci_get_domain_state(); if (!state) @@ -82,12 +82,12 @@ static int __psci_enter_domain_idle_state(struct cpuidl= e_device *dev, =20 ret =3D psci_cpu_suspend_enter(state) ? -1 : idx; =20 - 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(); =20 cpu_pm_exit(); =20 @@ -240,6 +240,7 @@ static int psci_dt_cpu_init_topology(struct cpuidle_dri= ver *drv, * of a shared state for the domain, assumes the domain states are all * deeper states. */ + drv->states[state_count - 1].flags |=3D CPUIDLE_FLAG_RCU_IDLE; drv->states[state_count - 1].enter =3D psci_enter_domain_idle_state; drv->states[state_count - 1].enter_s2idle =3D psci_enter_s2idle_domain_id= le_state; psci_cpuidle_use_cpuhp =3D true;