From: Peter Zijlstra <peterz@infradead.org>
To: peterz@infradead.org
Cc: juri.lelli@redhat.com, rafael@kernel.org,
benh@kernel.crashing.org, linus.walleij@linaro.org,
bsegall@google.com, guoren@kernel.org, pavel@ucw.cz,
agordeev@linux.ibm.com, linux-arch@vger.kernel.org,
vincent.guittot@linaro.org, mpe@ellerman.id.au,
chenhuacai@kernel.org, linux-acpi@vger.kernel.org,
agross@kernel.org, geert@linux-m68k.org, linux-imx@nxp.com,
catalin.marinas@arm.com, xen-devel@lists.xenproject.org,
mattst88@gmail.com, mturquette@baylibre.com, sammy@sammy.net,
pmladek@suse.com, linux-pm@vger.kernel.org,
jiangshanlai@gmail.com, Sascha Hauer <s.hauer@pengutronix.de>,
linux-um@lists.infradead.org, acme@kernel.org,
tglx@linutronix.de, linux-omap@vger.kernel.org,
dietmar.eggemann@arm.com, rth@twiddle.net,
gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
linux-perf-users@vger.kernel.org, senozhatsky@chromium.org,
svens@linux.ibm.com, jolsa@kernel.org, paul
Subject: [PATCH 12/36] cpuidle,omap2: Push RCU-idle into driver
Date: Wed, 08 Jun 2022 16:27:35 +0200 [thread overview]
Message-ID: <20220608144516.677524509@infradead.org> (raw)
In-Reply-To: 20220608142723.103523089@infradead.org
Doing RCU-idle outside the driver, only to then temporarily enable it
again, some *four* times, before going idle is daft.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
arch/arm/mach-omap2/cpuidle44xx.c | 29 ++++++++++++++++++-----------
1 file changed, 18 insertions(+), 11 deletions(-)
--- 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 cp
}
raw_spin_unlock_irqrestore(&mpu_lock, flag);
+ rcu_idle_enter();
omap4_enter_lowpower(dev->cpu, cx->cpu_state);
+ rcu_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(struc
(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(struc
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(struc
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;
}
}
}
+ rcu_idle_enter();
omap4_enter_lowpower(dev->cpu, cx->cpu_state);
cpu_done[dev->cpu] = true;
+ rcu_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(struc
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(struc
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_
/* 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_
/* 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_
/* 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",
next prev parent reply other threads:[~2022-06-08 14:27 UTC|newest]
Thread overview: 106+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-08 14:27 [PATCH 00/36] cpuidle,rcu: Cleanup the mess Peter Zijlstra
2022-06-08 14:27 ` [PATCH 01/36] x86/perf/amd: Remove tracing from perf_lopwr_cb() Peter Zijlstra
2022-06-08 14:27 ` [PATCH 02/36] x86/idle: Replace x86_idle with a static_call Peter Zijlstra
2022-06-08 18:13 ` Rafael J. Wysocki
2022-06-08 14:27 ` [PATCH 03/36] cpuidle/poll: Ensure IRQ state is invariant Peter Zijlstra
[not found] ` <20220608144516.109792837-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2022-07-06 13:51 ` Rafael J. Wysocki
2022-06-08 14:27 ` [PATCH 04/36] cpuidle,intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE Peter Zijlstra
2022-06-08 15:01 ` Rafael J. Wysocki
2022-06-08 15:48 ` Peter Zijlstra
2022-06-08 16:08 ` Rafael J. Wysocki
2022-06-09 23:49 ` Jacob Pan
2022-06-13 8:44 ` Peter Zijlstra
2022-06-16 21:26 ` Jacob Pan
2022-07-25 19:43 ` Michel Lespinasse
2022-07-28 17:20 ` Paul E. McKenney
2022-07-29 10:24 ` Michel Lespinasse
2022-07-29 14:59 ` Rafael J. Wysocki
2022-07-30 9:48 ` Michel Lespinasse
2022-07-30 19:52 ` Rafael J. Wysocki
2022-07-30 23:45 ` Michel Lespinasse
2022-07-29 15:26 ` Paul E. McKenney
2022-07-29 15:28 ` Paul E. McKenney
2022-07-30 9:40 ` Michel Lespinasse
2022-07-30 18:16 ` Paul E. McKenney
2022-06-08 14:27 ` [PATCH 05/36] cpuidle: Move IRQ state validation Peter Zijlstra
2022-07-06 13:54 ` Rafael J. Wysocki
2022-06-08 14:27 ` [PATCH 06/36] cpuidle,riscv: Push RCU-idle into driver Peter Zijlstra
2022-06-08 14:27 ` [PATCH 07/36] cpuidle,tegra: " Peter Zijlstra
2022-06-08 14:27 ` [PATCH 08/36] cpuidle,psci: " Peter Zijlstra
2022-06-08 14:27 ` [PATCH 09/36] cpuidle,imx6: " Peter Zijlstra
2022-06-08 14:27 ` [PATCH 10/36] cpuidle,omap3: " Peter Zijlstra
2022-06-13 12:33 ` Tony Lindgren
2022-06-08 14:27 ` [PATCH 11/36] cpuidle,armada: " Peter Zijlstra
2022-06-08 14:27 ` Peter Zijlstra [this message]
2022-06-13 12:33 ` [PATCH 12/36] cpuidle,omap2: " Tony Lindgren
2022-06-08 14:27 ` [PATCH 13/36] cpuidle,dt: " Peter Zijlstra
2022-06-08 14:27 ` [PATCH 14/36] cpuidle: Fix rcu_idle_*() usage Peter Zijlstra
2022-06-14 12:41 ` Mark Rutland
2022-06-14 16:40 ` Peter Zijlstra
2022-06-14 16:59 ` Mark Rutland
2022-07-26 9:56 ` Gautham R. Shenoy
2022-06-08 14:27 ` [PATCH 15/36] cpuidle,cpu_pm: Remove RCU fiddling from cpu_pm_{enter,exit}() Peter Zijlstra
2022-06-14 16:13 ` Mark Rutland
2022-06-14 16:42 ` Peter Zijlstra
2022-06-14 16:53 ` Mark Rutland
2022-06-08 14:27 ` [PATCH 16/36] rcu: Fix rcu_idle_exit() Peter Zijlstra
2022-06-14 16:14 ` Mark Rutland
2022-06-15 0:44 ` Paul E. McKenney
2022-06-08 14:27 ` [PATCH 17/36] acpi_idle: Remove tracing Peter Zijlstra
2022-07-06 13:59 ` Rafael J. Wysocki
2022-06-08 14:27 ` [PATCH 18/36] cpuidle: Annotate poll_idle() Peter Zijlstra
2022-07-06 14:00 ` Rafael J. Wysocki
2022-06-08 14:27 ` [PATCH 19/36] objtool/idle: Validate __cpuidle code as noinstr Peter Zijlstra
2022-07-06 9:46 ` Geert Uytterhoeven
2022-06-08 14:27 ` [PATCH 20/36] arch/idle: Change arch_cpu_idle() IRQ behaviour Peter Zijlstra
2022-06-08 16:22 ` Arnd Bergmann
2022-06-14 16:22 ` Mark Rutland
2022-07-06 14:02 ` Rafael J. Wysocki
2022-06-08 14:27 ` [PATCH 21/36] x86/tdx: Remove TDX_HCALL_ISSUE_STI Peter Zijlstra
2022-06-13 8:26 ` Lai Jiangshan
2022-06-13 8:41 ` Peter Zijlstra
2022-06-08 14:27 ` [PATCH 22/36] arm,smp: Remove trace_.*_rcuidle() usage Peter Zijlstra
2022-06-08 14:27 ` [PATCH 23/36] arm64,smp: " Peter Zijlstra
2022-06-14 16:24 ` Mark Rutland
2022-06-15 6:05 ` Marc Zyngier
2022-06-08 14:27 ` [PATCH 24/36] printk: " Peter Zijlstra
2022-06-09 9:16 ` Petr Mladek
2022-06-09 10:02 ` Peter Zijlstra
2022-06-09 11:30 ` Sergey Senozhatsky
2022-06-09 13:02 ` Petr Mladek
2022-06-11 2:33 ` Sergey Senozhatsky
2022-06-14 14:37 ` Steven Rostedt
2022-06-09 13:06 ` Petr Mladek
2022-06-11 2:23 ` Sergey Senozhatsky
2022-06-09 10:14 ` Petr Mladek
2022-06-08 14:27 ` [PATCH 25/36] time/tick-broadcast: Remove RCU_NONIDLE usage Peter Zijlstra
2022-06-14 16:28 ` Mark Rutland
2022-06-08 14:27 ` [PATCH 26/36] cpuidle,sched: Remove annotations from TIF_{POLLING_NRFLAG,NEED_RESCHED} Peter Zijlstra
2022-06-08 14:27 ` [PATCH 27/36] cpuidle,mwait: Make noinstr clean Peter Zijlstra
2022-06-08 14:27 ` [PATCH 28/36] cpuidle,tdx: Make tdx " Peter Zijlstra
2022-06-08 14:27 ` [PATCH 29/36] cpuidle,xenpv: Make more PARAVIRT_XXL " Peter Zijlstra
2022-06-13 18:48 ` [PATCH 29/36] cpuidle, xenpv: " Srivatsa S. Bhat
2022-06-13 19:23 ` [Pv-drivers] " Nadav Amit via Virtualization
2022-06-14 16:44 ` Peter Zijlstra
2022-06-08 14:27 ` [PATCH 30/36] cpuidle,nospec: Make " Peter Zijlstra
2022-06-08 14:27 ` [PATCH 31/36] cpuidle,acpi: " Peter Zijlstra
2022-07-06 14:04 ` Rafael J. Wysocki
2022-06-08 14:27 ` [PATCH 32/36] ftrace: WARN on rcuidle Peter Zijlstra
2022-06-08 14:27 ` [PATCH 33/36] cpuidle,omap3: Use WFI for omap3_pm_idle() Peter Zijlstra
2022-06-08 16:28 ` Arnd Bergmann
2022-06-09 7:39 ` Tony Lindgren
2022-06-09 9:47 ` Peter Zijlstra
2022-06-09 9:40 ` Peter Zijlstra
2022-06-13 12:36 ` Tony Lindgren
2022-06-08 14:27 ` [PATCH 34/36] cpuidle,omap3: Push RCU-idle into omap_sram_idle() Peter Zijlstra
2022-06-08 15:04 ` Peter Zijlstra
[not found] ` <YqC6iJx4ygSmry0G@hirez.programming.kicks-ass.net>
2022-06-13 12:35 ` Tony Lindgren
2022-06-13 12:39 ` [PATCH 34.5/36] cpuidle,omap4: Push RCU-idle into omap4_enter_lowpower() Tony Lindgren
2022-06-14 22:12 ` Peter Zijlstra
[not found] ` <YqkHto+zgAPs4kQI-IIpfhp3q70z/8w/KjCw3T+5/BudmfyzbbVWyRVo5IupeoWH0uzbU5w@public.gmane.org>
2022-06-15 5:35 ` Tony Lindgren
2022-06-08 14:27 ` [PATCH 35/36] cpuidle,powerdomain: Remove trace_.*_rcuidle() Peter Zijlstra
2022-06-08 14:27 ` [PATCH 36/36] cpuidle,clk: " Peter Zijlstra
2022-06-08 20:03 ` Stephen Boyd
2022-06-14 11:19 ` [PATCH 00/36] cpuidle,rcu: Cleanup the mess Mark Rutland
2022-06-14 16:58 ` Peter Zijlstra
2022-06-14 17:33 ` Mark Rutland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220608144516.677524509@infradead.org \
--to=peterz@infradead.org \
--cc=acme@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=agross@kernel.org \
--cc=benh@kernel.crashing.org \
--cc=bsegall@google.com \
--cc=catalin.marinas@arm.com \
--cc=chenhuacai@kernel.org \
--cc=dietmar.eggemann@arm.com \
--cc=geert@linux-m68k.org \
--cc=gregkh@linuxfoundation.org \
--cc=guoren@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=jolsa@kernel.org \
--cc=juri.lelli@redhat.com \
--cc=linus.walleij@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=mattst88@gmail.com \
--cc=mpe@ellerman.id.au \
--cc=mturquette@baylibre.com \
--cc=pavel@ucw.cz \
--cc=pmladek@suse.com \
--cc=rafael@kernel.org \
--cc=rth@twiddle.net \
--cc=s.hauer@pengutronix.de \
--cc=sammy@sammy.net \
--cc=senozhatsky@chromium.org \
--cc=svens@linux.ibm.com \
--cc=tglx@linutronix.de \
--cc=vincent.guittot@linaro.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).