mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
powerpc: Fix RCU idle and hcall tracing
Tracepoints should not be called inside an rcu_idle_enter/rcu_idle_exit
region. Since pSeries calls H_CEDE in the idle loop, we were violating
this rule.
commit a7b152d534
(powerpc: Tell RCU about idle after hcall tracing)
tried to work around it by delaying the rcu_idle_enter until after we
called the hcall tracepoint, but there are a number of issues with it.
The hcall tracepoint trampoline code is called conditionally when the
tracepoint is enabled. If the tracepoint is not enabled we never call
rcu_idle_enter. The idle_uses_rcu check was also done at compile time
which breaks multiplatform builds.
The simple fix is to avoid tracing H_CEDE and rely on other tracepoints
and the hypervisor dispatch trace log to work out if we called H_CEDE.
This fixes a hang during boot on pSeries.
Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
parent
7b3480f8b7
commit
a5ccfee05a
2 changed files with 12 additions and 14 deletions
|
@ -50,12 +50,6 @@ static int __init powersave_off(char *arg)
|
|||
}
|
||||
__setup("powersave=off", powersave_off);
|
||||
|
||||
#if defined(CONFIG_PPC_PSERIES) && defined(CONFIG_TRACEPOINTS)
|
||||
static const bool idle_uses_rcu = 1;
|
||||
#else
|
||||
static const bool idle_uses_rcu;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The body of the idle task.
|
||||
*/
|
||||
|
@ -67,8 +61,7 @@ void cpu_idle(void)
|
|||
set_thread_flag(TIF_POLLING_NRFLAG);
|
||||
while (1) {
|
||||
tick_nohz_idle_enter();
|
||||
if (!idle_uses_rcu)
|
||||
rcu_idle_enter();
|
||||
rcu_idle_enter();
|
||||
|
||||
while (!need_resched() && !cpu_should_die()) {
|
||||
ppc64_runlatch_off();
|
||||
|
@ -106,8 +99,7 @@ void cpu_idle(void)
|
|||
|
||||
HMT_medium();
|
||||
ppc64_runlatch_on();
|
||||
if (!idle_uses_rcu)
|
||||
rcu_idle_exit();
|
||||
rcu_idle_exit();
|
||||
tick_nohz_idle_exit();
|
||||
preempt_enable_no_resched();
|
||||
if (cpu_should_die())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue