From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Alessio Igor Bogani <abogani@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Avi Kivity <avi@redhat.com>, Chris Metcalf <cmetcalf@tilera.com>,
Christoph Lameter <cl@linux.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Geoff Levand <geoff@infradead.org>,
Gilad Ben Yossef <gilad@benyossef.com>,
Hakan Akkan <hakanakkan@gmail.com>, Kevin Hilman <khilman@ti.com>,
Max Krasnyansky <maxk@qualcomm.com>,
Peter Zijlstra <peterz@infradead.org>,
Stephen Hemminger <shemminger@vyatta.com>,
Steven Rostedt <rostedt@goodmis.org>,
Sven-Thorsten Dietrich <thebigcorporation@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH v2] rcu: Allow calls to rcu_exit_user_irq from nesting irqs
Date: Mon, 11 Jun 2012 14:55:46 -0700 [thread overview]
Message-ID: <20120611215546.GH2521@linux.vnet.ibm.com> (raw)
In-Reply-To: <20120610214722.GE31957@somewhere.redhat.com>
On Sun, Jun 10, 2012 at 11:47:26PM +0200, Frederic Weisbecker wrote:
> From: Frederic Weisbecker <fweisbec@gmail.com>
> Date: Sat, 9 Jun 2012 14:06:30 +0200
> Subject: [PATCH] rcu: Allow calls to rcu_exit_user_irq from nesting irqs
>
> rcu_exit_user_irq() which exits RCU idle mode after the current
> irq returns has been designed to be called from non nesting irqs
> only.
>
> However the IPI that restarts the tick and exits RCU user-idle mode
> in nohz cpusets can happen anytime. For example it can be a nesting
> irq by interrupting a softirq. In this case the stack of RCU API
> calls becomes:
>
> ==> IRQ
> rcu_irq_enter()
> ....
> do_softirq {
> ===== > IRQ (restart tick IPI)
> rcu_irq_enter()
> rcu_exit_user_irq()
> rcu_irq_exit()
> <=====
> }
> rcu_irq_exit();
>
> Hence we need to make rcu_exit_user_irq() callable from any nesting
> level of interrupt.
>
> v2: rcu_user_enter_irq() is only called from non nesting irqs though so
> the change doesn't need to be propagated to it.
I have queued this on -rcu on branch rcu/idle. I have also removed
the TINY_RCU commits as discussed. If you ever need them back, the
magic branch name is idle.2012.06.06a.
Thanx, Paul
> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> ---
> kernel/rcutree.c | 19 ++++++++-----------
> 1 files changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/kernel/rcutree.c b/kernel/rcutree.c
> index 1b0dca2..7a54265 100644
> --- a/kernel/rcutree.c
> +++ b/kernel/rcutree.c
> @@ -619,12 +619,12 @@ void rcu_user_exit(void)
>
> /**
> * rcu_user_exit_irq - inform RCU that we won't resume to userspace
> - * idle mode after the current irq returns.
> + * idle mode after the current non-nesting irq returns.
> *
> - * This is similar to rcu_user_exit() but in the context of a non
> - * nesting irq. This is called when the irq has interrupted a userspace
> - * RCU idle mode context. When the interrupt returns after this call,
> - * the CPU won't restore the RCU idle mode.
> + * This is similar to rcu_user_exit() but in the context of an
> + * irq. This is called when the irq has interrupted a userspace
> + * RCU idle mode context. When the current non-nesting interrupt
> + * returns after this call, the CPU won't restore the RCU idle mode.
> */
> void rcu_user_exit_irq(void)
> {
> @@ -633,12 +633,9 @@ void rcu_user_exit_irq(void)
>
> local_irq_save(flags);
> rdtp = &__get_cpu_var(rcu_dynticks);
> - /*
> - * Ensure this irq is a non-nesting one interrupting
> - * an RCU idle mode.
> - */
> - WARN_ON_ONCE(rdtp->dynticks_nesting != 1);
> - rdtp->dynticks_nesting = DYNTICK_TASK_EXIT_IDLE + 1;
> + /* Ensure we are interrupting an RCU idle mode. */
> + WARN_ON_ONCE(rdtp->dynticks_nesting & DYNTICK_TASK_NEST_MASK);
> + rdtp->dynticks_nesting += DYNTICK_TASK_EXIT_IDLE;
> local_irq_restore(flags);
> }
>
> --
> 1.7.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
next prev parent reply other threads:[~2012-06-11 21:55 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-04 12:08 [PATCH 0/2] rcu: Extended quiescent state for adaptive nohz fweisbec
2012-06-04 12:08 ` [PATCH 1/2] rcu: New rcu_user_enter() and rcu_user_exit() APIs fweisbec
2012-06-04 12:08 ` [PATCH 2/2] rcu: New rcu_user_enter_irq() and rcu_user_exit_irq() APIs fweisbec
2012-06-04 18:13 ` [PATCH 0/2] rcu: Extended quiescent state for adaptive nohz Paul E. McKenney
2012-06-04 19:06 ` Frederic Weisbecker
2012-06-04 21:07 ` Paul E. McKenney
2012-06-05 10:31 ` Frederic Weisbecker
2012-06-05 23:46 ` Paul E. McKenney
2012-06-07 14:21 ` Frederic Weisbecker
2012-06-07 22:45 ` Paul E. McKenney
2012-06-09 22:58 ` Frederic Weisbecker
2012-06-10 17:54 ` Paul E. McKenney
2012-06-09 22:55 ` [PATCH] rcu: Allow calls to rcu_exit_user_irq from nesting irqs Frederic Weisbecker
2012-06-10 18:06 ` Paul E. McKenney
2012-06-10 20:29 ` Frederic Weisbecker
2012-06-10 21:47 ` [PATCH v2] " Frederic Weisbecker
2012-06-11 21:55 ` Paul E. McKenney [this message]
2012-06-11 22:06 ` Frederic Weisbecker
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=20120611215546.GH2521@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=abogani@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=avi@redhat.com \
--cc=cl@linux.com \
--cc=cmetcalf@tilera.com \
--cc=daniel.lezcano@linaro.org \
--cc=fweisbec@gmail.com \
--cc=geoff@infradead.org \
--cc=gilad@benyossef.com \
--cc=hakanakkan@gmail.com \
--cc=khilman@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maxk@qualcomm.com \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=shemminger@vyatta.com \
--cc=tglx@linutronix.de \
--cc=thebigcorporation@gmail.com \
/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