[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120615210444.GP31184@leaf>
Date: Fri, 15 Jun 2012 14:04:45 -0700
From: Josh Triplett <josh@...htriplett.org>
To: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc: linux-kernel@...r.kernel.org, mingo@...e.hu, laijs@...fujitsu.com,
dipankar@...ibm.com, akpm@...ux-foundation.org,
mathieu.desnoyers@...ymtl.ca, niv@...ibm.com, tglx@...utronix.de,
peterz@...radead.org, rostedt@...dmis.org, Valdis.Kletnieks@...edu,
dhowells@...hat.com, eric.dumazet@...il.com, darren@...art.com,
fweisbec@...il.com, patches@...aro.org,
"Paul E. McKenney" <paul.mckenney@...aro.org>
Subject: Re: [PATCH tip/core/rcu 12/14] rcu: Prevent __call_rcu() from
invoking RCU core on offline CPUs
On Fri, Jun 15, 2012 at 01:13:13PM -0700, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paul.mckenney@...aro.org>
>
> The __call_rcu() function will invoke the RCU core, for example, if
> it detects that the current CPU has too many callbacks. However, this
> can happen on an offline CPU that is on its way to the idle loop, in
> which case it is an error to invoke the RCU core, and the excess callbacks
> will be adopted in any case. This commit therefore adds checks to
> __call_rcu() for running on an offline CPU, refraining from invoking
> the RCU core in this case.
>
> Signed-off-by: Paul E. McKenney <paul.mckenney@...aro.org>
> Signed-off-by: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@...htriplett.org>
> kernel/rcutree.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/rcutree.c b/kernel/rcutree.c
> index 7720177..9419ebf 100644
> --- a/kernel/rcutree.c
> +++ b/kernel/rcutree.c
> @@ -1901,11 +1901,11 @@ __call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu),
> * If called from an extended quiescent state, invoke the RCU
> * core in order to force a re-evaluation of RCU's idleness.
> */
> - if (rcu_is_cpu_idle())
> + if (rcu_is_cpu_idle() && cpu_online(smp_processor_id()))
> invoke_rcu_core();
>
> - /* If interrupts were disabled, don't dive into RCU core. */
> - if (irqs_disabled_flags(flags)) {
> + /* If interrupts were disabled or CPU offline, don't invoke RCU core. */
> + if (irqs_disabled_flags(flags) || cpu_is_offline(smp_processor_id())) {
> local_irq_restore(flags);
> return;
> }
> --
> 1.7.8
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists