* [PATCH tip/core/rcu 15/26] alpha: Fix preemption handling in idle loop
[not found] ` <1346360743-3628-1-git-send-email-paulmck@linux.vnet.ibm.com>
@ 2012-08-30 21:05 ` Paul E. McKenney
2012-08-31 23:55 ` Josh Triplett
2012-08-30 21:05 ` [PATCH tip/core/rcu 16/26] alpha: Add missing RCU idle APIs on " Paul E. McKenney
1 sibling, 1 reply; 4+ messages in thread
From: Paul E. McKenney @ 2012-08-30 21:05 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, Valdis.Kletnieks, dhowells, eric.dumazet, darren,
fweisbec, sbw, patches, Richard Henderson, Ivan Kokshaysky,
Matt Turner, alpha, Paul E. McKenney, Michael Cree
From: Frederic Weisbecker <fweisbec@gmail.com>
cpu_idle() is called on the boot CPU by the init code with
preemption disabled. But the cpu_idle() function in alpha
doesn't handle this when it calls schedule() directly.
Fix it by converting it into schedule_preempt_disabled().
Also disable preemption before calling cpu_idle() from
secondary CPU entry code to stay consistent with this
state.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: alpha <linux-alpha@vger.kernel.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Michael Cree <mcree@orcon.net.nz>
---
arch/alpha/kernel/process.c | 3 ++-
arch/alpha/kernel/smp.c | 1 +
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index 153d3fc..eac5e01 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -56,7 +56,8 @@ cpu_idle(void)
while (!need_resched())
cpu_relax();
- schedule();
+
+ schedule_preempt_disabled();
}
}
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index 35ddc02..a41ad90 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -166,6 +166,7 @@ smp_callin(void)
DBGS(("smp_callin: commencing CPU %d current %p active_mm %p\n",
cpuid, current, current->active_mm));
+ preempt_disable();
/* Do nothing. */
cpu_idle();
}
--
1.7.8
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH tip/core/rcu 16/26] alpha: Add missing RCU idle APIs on idle loop
[not found] ` <1346360743-3628-1-git-send-email-paulmck@linux.vnet.ibm.com>
2012-08-30 21:05 ` [PATCH tip/core/rcu 15/26] alpha: Fix preemption handling in idle loop Paul E. McKenney
@ 2012-08-30 21:05 ` Paul E. McKenney
2012-09-01 0:00 ` Josh Triplett
1 sibling, 1 reply; 4+ messages in thread
From: Paul E. McKenney @ 2012-08-30 21:05 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, Valdis.Kletnieks, dhowells, eric.dumazet, darren,
fweisbec, sbw, patches, Richard Henderson, Ivan Kokshaysky,
Matt Turner, alpha, Paul E. McKenney, Michael Cree, 3.2.x..
From: Frederic Weisbecker <fweisbec@gmail.com>
In the old times, the whole idle task was considered
as an RCU quiescent state. But as RCU became more and
more successful overtime, some RCU read side critical
section have been added even in the code of some
architectures idle tasks, for tracing for example.
So nowadays, rcu_idle_enter() and rcu_idle_exit() must
be called by the architecture to tell RCU about the part
in the idle loop that doesn't make use of rcu read side
critical sections, typically the part that puts the CPU
in low power mode.
This is necessary for RCU to find the quiescent states in
idle in order to complete grace periods.
Add this missing pair of calls in the Alpha's idle loop.
Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: alpha <linux-alpha@vger.kernel.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Michael Cree <mcree@orcon.net.nz>
Cc: 3.2.x.. <stable@vger.kernel.org>
---
arch/alpha/kernel/process.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index eac5e01..eb9558c 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -28,6 +28,7 @@
#include <linux/tty.h>
#include <linux/console.h>
#include <linux/slab.h>
+#include <linux/rcupdate.h>
#include <asm/reg.h>
#include <asm/uaccess.h>
@@ -54,9 +55,11 @@ cpu_idle(void)
/* FIXME -- EV6 and LCA45 know how to power down
the CPU. */
+ rcu_idle_enter();
while (!need_resched())
cpu_relax();
+ rcu_idle_exit();
schedule_preempt_disabled();
}
}
--
1.7.8
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH tip/core/rcu 15/26] alpha: Fix preemption handling in idle loop
2012-08-30 21:05 ` [PATCH tip/core/rcu 15/26] alpha: Fix preemption handling in idle loop Paul E. McKenney
@ 2012-08-31 23:55 ` Josh Triplett
0 siblings, 0 replies; 4+ messages in thread
From: Josh Triplett @ 2012-08-31 23:55 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, Valdis.Kletnieks, dhowells,
eric.dumazet, darren, fweisbec, sbw, patches, Richard Henderson,
Ivan Kokshaysky, Matt Turner, alpha, Michael Cree
On Thu, Aug 30, 2012 at 02:05:32PM -0700, Paul E. McKenney wrote:
> From: Frederic Weisbecker <fweisbec@gmail.com>
>
> cpu_idle() is called on the boot CPU by the init code with
> preemption disabled. But the cpu_idle() function in alpha
> doesn't handle this when it calls schedule() directly.
>
> Fix it by converting it into schedule_preempt_disabled().
>
> Also disable preemption before calling cpu_idle() from
> secondary CPU entry code to stay consistent with this
> state.
>
> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> Cc: Matt Turner <mattst88@gmail.com>
> Cc: alpha <linux-alpha@vger.kernel.org>
> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Cc: Michael Cree <mcree@orcon.net.nz>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> arch/alpha/kernel/process.c | 3 ++-
> arch/alpha/kernel/smp.c | 1 +
> 2 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
> index 153d3fc..eac5e01 100644
> --- a/arch/alpha/kernel/process.c
> +++ b/arch/alpha/kernel/process.c
> @@ -56,7 +56,8 @@ cpu_idle(void)
>
> while (!need_resched())
> cpu_relax();
> - schedule();
> +
> + schedule_preempt_disabled();
> }
> }
>
> diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
> index 35ddc02..a41ad90 100644
> --- a/arch/alpha/kernel/smp.c
> +++ b/arch/alpha/kernel/smp.c
> @@ -166,6 +166,7 @@ smp_callin(void)
> DBGS(("smp_callin: commencing CPU %d current %p active_mm %p\n",
> cpuid, current, current->active_mm));
>
> + preempt_disable();
> /* Do nothing. */
> cpu_idle();
> }
> --
> 1.7.8
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH tip/core/rcu 16/26] alpha: Add missing RCU idle APIs on idle loop
2012-08-30 21:05 ` [PATCH tip/core/rcu 16/26] alpha: Add missing RCU idle APIs on " Paul E. McKenney
@ 2012-09-01 0:00 ` Josh Triplett
0 siblings, 0 replies; 4+ messages in thread
From: Josh Triplett @ 2012-09-01 0:00 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, Valdis.Kletnieks, dhowells,
eric.dumazet, darren, fweisbec, sbw, patches, Richard Henderson,
Ivan Kokshaysky, Matt Turner, alpha, Michael Cree, 3.2.x..
On Thu, Aug 30, 2012 at 02:05:33PM -0700, Paul E. McKenney wrote:
> From: Frederic Weisbecker <fweisbec@gmail.com>
>
> In the old times, the whole idle task was considered
> as an RCU quiescent state. But as RCU became more and
> more successful overtime, some RCU read side critical
> section have been added even in the code of some
> architectures idle tasks, for tracing for example.
>
> So nowadays, rcu_idle_enter() and rcu_idle_exit() must
> be called by the architecture to tell RCU about the part
> in the idle loop that doesn't make use of rcu read side
> critical sections, typically the part that puts the CPU
> in low power mode.
>
> This is necessary for RCU to find the quiescent states in
> idle in order to complete grace periods.
>
> Add this missing pair of calls in the Alpha's idle loop.
>
> Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> Cc: Matt Turner <mattst88@gmail.com>
> Cc: alpha <linux-alpha@vger.kernel.org>
> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Cc: Michael Cree <mcree@orcon.net.nz>
> Cc: 3.2.x.. <stable@vger.kernel.org>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> arch/alpha/kernel/process.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
> index eac5e01..eb9558c 100644
> --- a/arch/alpha/kernel/process.c
> +++ b/arch/alpha/kernel/process.c
> @@ -28,6 +28,7 @@
> #include <linux/tty.h>
> #include <linux/console.h>
> #include <linux/slab.h>
> +#include <linux/rcupdate.h>
>
> #include <asm/reg.h>
> #include <asm/uaccess.h>
> @@ -54,9 +55,11 @@ cpu_idle(void)
> /* FIXME -- EV6 and LCA45 know how to power down
> the CPU. */
>
> + rcu_idle_enter();
> while (!need_resched())
> cpu_relax();
>
> + rcu_idle_exit();
> schedule_preempt_disabled();
> }
> }
> --
> 1.7.8
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-09-01 0:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20120830210520.GA2824@linux.vnet.ibm.com>
[not found] ` <1346360743-3628-1-git-send-email-paulmck@linux.vnet.ibm.com>
2012-08-30 21:05 ` [PATCH tip/core/rcu 15/26] alpha: Fix preemption handling in idle loop Paul E. McKenney
2012-08-31 23:55 ` Josh Triplett
2012-08-30 21:05 ` [PATCH tip/core/rcu 16/26] alpha: Add missing RCU idle APIs on " Paul E. McKenney
2012-09-01 0:00 ` Josh Triplett
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).