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: 43259 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp244380wrt; Fri, 13 Jan 2023 04:38:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXu+JPRrmCG6oSX9o+H8IqcI05Al57dYfKlyQG7B5G6MMiH6v+r5zRoJdxxGzQ0j8PNvspsU X-Received: by 2002:a17:906:a20e:b0:84d:37d4:7530 with SMTP id r14-20020a170906a20e00b0084d37d47530mr19833521ejy.53.1673613481383; Fri, 13 Jan 2023 04:38:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673613481; cv=none; d=google.com; s=arc-20160816; b=iR1gru/EDoZ5o695AvyNNR1iBxg/I56FEje89zRnMo/E5jE2PXtBlzhcj4p7em55Hr ii7kXnt9p45Kj9ZbhXoJPaKVdCt26rYzQnOFL3zJ2gLhfV3J66ywHprUniTDbOsY7RJ6 p2FuTP8rNThSX5MKZiXEYgc6apyABsFxmM6wEN9N+Ry3nyAFFRpLrDmauN9zlVKgu0qM Ed2CEMVG7s2e8xOwa84FRNH0I7GvllDt34WCfXRftYzJu3KzMOOmQw0v9EVgJnk24YMT Ij3/pOuKx3hq8ciNq8K2qga1O34xb9l8mUEsHNkDcAnhUFhxrQBfEyTZeh+z4XMypFYi Kk4Q== 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=ZSzC2dWr0AP5Ym/dMH83OBLZ+AOZhxLm3b0LmSfsXTc=; b=ewOpsiFa1Z0b0XNL+iK2X7zUu0ssVjXV64IzaigaZ0Va/grgr6mDWVVxd+CUtf9sPe JHFgRwuzdBfcHJwYiECiguKiwQIwJQThpQgWCy0BBn4THYVxB0PvbSEk6mdcNrNo0Xhy BdS9Xzshm2aNzriHixxt5LWYCpT57fEQcJIIdmXaFOnjWrtkxTSR5Rxs9RhtrMOkUMSh oC5/f55/MAQnu3wTLbdUjbhLXMDRfy9iffxzVqnWWY2vKcAvQHWe2zTYMuOIOpHMnxx2 mK59DnGD4kOfnL+BY8Vy3PnWm6zHc93fKvZ0+eItjzFopZWVXhJ8xtQD4drN2k0hLkSc ZobA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=pHPh2Pnc; 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 xe6-20020a170907318600b0084cbde35b2fsi21803130ejb.465.2023.01.13.04.37.37; Fri, 13 Jan 2023 04:38:01 -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=pHPh2Pnc; 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 S241250AbjAMMgZ (ORCPT + 99 others); Fri, 13 Jan 2023 07:36:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233174AbjAMMcS (ORCPT ); Fri, 13 Jan 2023 07:32:18 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2164564EA; Fri, 13 Jan 2023 04:31:15 -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=1673613074; 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=ZSzC2dWr0AP5Ym/dMH83OBLZ+AOZhxLm3b0LmSfsXTc=; b=pHPh2PncUBc6Utw4Vwr28dhOWSJdf/pJUYM8DakK3Ls52vxPTjKxkDJDr3hLOnYErv5Flo PDV3MbTYb2CDgW2RvYBClceCG/QBFlbWS30K3DCA72PdwONgkd2q7KJU74yRIiQkQ6i8iD rrU4aUWayRyPdAdyox1rPz20banZ4KX5n6k+39bjvZFexj1RTX5WS+Wc3WioVFjjznmzSj niV7qcjXZzR42D5JET70SaYifJFuLJvk/pEaQH9Az/PQ4vKGWJxUoOW9/d8okY25/8KZmh rhv7Fb2K9SzGqoVYMHV57UAZ9CMcLWEBou4HJX7NcgWk0Bug68gKfSqpmylQPw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1673613074; 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=ZSzC2dWr0AP5Ym/dMH83OBLZ+AOZhxLm3b0LmSfsXTc=; b=KhgbO/j8UKs8GfGa0JQpztn5GcnlV+gvnmWYTMsC9RE5eihT4x6PX0CYWDehuy2aeOqEtB u9JB1mTpBzcJzQBw== 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, OMAP4: Push RCU-idle into driver Cc: "Peter Zijlstra (Intel)" , Ingo Molnar , Tony Lindgren , Ulf Hansson , Frederic Weisbecker , "Rafael J. Wysocki" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230112195540.007918454@infradead.org> References: <20230112195540.007918454@infradead.org> MIME-Version: 1.0 Message-ID: <167361307406.4906.17916090208644946752.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?1754910929912790025?= X-GMAIL-MSGID: =?utf-8?q?1754910929912790025?= The following commit has been merged into the sched/core branch of tip: Commit-ID: c3d42418dca53d6c498a48c408f7a45289593650 Gitweb: https://git.kernel.org/tip/c3d42418dca53d6c498a48c408f7a45289593650 Author: Peter Zijlstra AuthorDate: Thu, 12 Jan 2023 20:43:25 +01:00 Committer: Ingo Molnar CommitterDate: Fri, 13 Jan 2023 11:47:49 +01:00 cpuidle, OMAP4: Push RCU-idle into driver Doing RCU-idle outside the driver, only to then temporarily enable it again, some *four* times, before going idle is suboptimal. Notably three times explicitly using RCU_NONIDLE() and once implicitly through cpu_pm_*(). Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Tested-by: Tony Lindgren Tested-by: Ulf Hansson Reviewed-by: Frederic Weisbecker Reviewed-by: Tony Lindgren Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20230112195540.007918454@infradead.org --- arch/arm/mach-omap2/cpuidle44xx.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c index de37027..953ad88 100644 --- a/arch/arm/mach-omap2/cpuidle44xx.c +++ b/arch/arm/mach-omap2/cpuidle44xx.c @@ -105,7 +105,9 @@ static int omap_enter_idle_smp(struct cpuidle_device *dev, } raw_spin_unlock_irqrestore(&mpu_lock, flag); + ct_idle_enter(); omap4_enter_lowpower(dev->cpu, cx->cpu_state); + ct_idle_exit(); raw_spin_lock_irqsave(&mpu_lock, flag); if (cx->mpu_state_vote == num_online_cpus()) @@ -151,10 +153,10 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, (cx->mpu_logic_state == PWRDM_POWER_OFF); /* Enter broadcast mode for periodic timers */ - RCU_NONIDLE(tick_broadcast_enable()); + tick_broadcast_enable(); /* Enter broadcast mode for one-shot timers */ - RCU_NONIDLE(tick_broadcast_enter()); + tick_broadcast_enter(); /* * Call idle CPU PM enter notifier chain so that @@ -166,7 +168,7 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, if (dev->cpu == 0) { pwrdm_set_logic_retst(mpu_pd, cx->mpu_logic_state); - RCU_NONIDLE(omap_set_pwrdm_state(mpu_pd, cx->mpu_state)); + omap_set_pwrdm_state(mpu_pd, cx->mpu_state); /* * Call idle CPU cluster PM enter notifier chain @@ -178,14 +180,16 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, index = 0; cx = state_ptr + index; pwrdm_set_logic_retst(mpu_pd, cx->mpu_logic_state); - RCU_NONIDLE(omap_set_pwrdm_state(mpu_pd, cx->mpu_state)); + omap_set_pwrdm_state(mpu_pd, cx->mpu_state); mpuss_can_lose_context = 0; } } } + ct_idle_enter(); omap4_enter_lowpower(dev->cpu, cx->cpu_state); cpu_done[dev->cpu] = true; + ct_idle_exit(); /* Wakeup CPU1 only if it is not offlined */ if (dev->cpu == 0 && cpumask_test_cpu(1, cpu_online_mask)) { @@ -194,9 +198,9 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, mpuss_can_lose_context) gic_dist_disable(); - RCU_NONIDLE(clkdm_deny_idle(cpu_clkdm[1])); - RCU_NONIDLE(omap_set_pwrdm_state(cpu_pd[1], PWRDM_POWER_ON)); - RCU_NONIDLE(clkdm_allow_idle(cpu_clkdm[1])); + clkdm_deny_idle(cpu_clkdm[1]); + omap_set_pwrdm_state(cpu_pd[1], PWRDM_POWER_ON); + clkdm_allow_idle(cpu_clkdm[1]); if (IS_PM44XX_ERRATUM(PM_OMAP4_ROM_SMP_BOOT_ERRATUM_GICD) && mpuss_can_lose_context) { @@ -222,7 +226,7 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, cpu_pm_exit(); cpu_pm_out: - RCU_NONIDLE(tick_broadcast_exit()); + tick_broadcast_exit(); fail: cpuidle_coupled_parallel_barrier(dev, &abort_barrier); @@ -247,7 +251,8 @@ static struct cpuidle_driver omap4_idle_driver = { /* C2 - CPU0 OFF + CPU1 OFF + MPU CSWR */ .exit_latency = 328 + 440, .target_residency = 960, - .flags = CPUIDLE_FLAG_COUPLED, + .flags = CPUIDLE_FLAG_COUPLED | + CPUIDLE_FLAG_RCU_IDLE, .enter = omap_enter_idle_coupled, .name = "C2", .desc = "CPUx OFF, MPUSS CSWR", @@ -256,7 +261,8 @@ static struct cpuidle_driver omap4_idle_driver = { /* C3 - CPU0 OFF + CPU1 OFF + MPU OSWR */ .exit_latency = 460 + 518, .target_residency = 1100, - .flags = CPUIDLE_FLAG_COUPLED, + .flags = CPUIDLE_FLAG_COUPLED | + CPUIDLE_FLAG_RCU_IDLE, .enter = omap_enter_idle_coupled, .name = "C3", .desc = "CPUx OFF, MPUSS OSWR", @@ -282,7 +288,8 @@ static struct cpuidle_driver omap5_idle_driver = { /* C2 - CPU0 RET + CPU1 RET + MPU CSWR */ .exit_latency = 48 + 60, .target_residency = 100, - .flags = CPUIDLE_FLAG_TIMER_STOP, + .flags = CPUIDLE_FLAG_TIMER_STOP | + CPUIDLE_FLAG_RCU_IDLE, .enter = omap_enter_idle_smp, .name = "C2", .desc = "CPUx CSWR, MPUSS CSWR",