[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120709173910.GA8185@somewhere.redhat.com>
Date: Mon, 9 Jul 2012 19:39:14 +0200
From: Frederic Weisbecker <fweisbec@...il.com>
To: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Alessio Igor Bogani <abogani@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Avi Kivity <avi@...hat.com>,
Chris Metcalf <cmetcalf@...era.com>,
Christoph Lameter <cl@...ux.com>,
Geoff Levand <geoff@...radead.org>,
Gilad Ben Yossef <gilad@...yossef.com>,
Hakan Akkan <hakanakkan@...il.com>,
"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...nel.org>,
Josh Triplett <josh@...htriplett.org>,
Kevin Hilman <khilman@...com>,
Max Krasnyansky <maxk@...lcomm.com>,
Peter Zijlstra <peterz@...radead.org>,
Stephen Hemminger <shemminger@...tta.com>,
Steven Rostedt <rostedt@...dmis.org>,
Sven-Thorsten Dietrich <thebigcorporation@...il.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 2/6] rcu: Allow rcu_user_enter()/exit() to nest
On Fri, Jul 06, 2012 at 09:27:09AM -0700, Paul E. McKenney wrote:
> On Fri, Jul 06, 2012 at 02:00:14PM +0200, Frederic Weisbecker wrote:
> > Allow calls to rcu_user_enter() even if we are already
> > in userspace (as seen by RCU) and allow calls to rcu_user_exit()
> > even if we are already in the kernel.
> >
> > This makes the APIs more flexible to be called from architectures.
> > Exception entries for example won't need to know if they come from
> > userspace before calling rcu_user_exit().
>
> You lost me on this one. As long as the nesting level stays below
> a few tens, rcu_user_enter() and rcu_user_exit() already can nest.
>
> Or are you saying that you need to deal with duplicate rcu_user_enter()
> calls that must be matched by a single rcu_user_exit() call?
Yep, we can have that kind of thing:
in_user = 1
==== syscall
rcu_user_exit() // in_user = 0
==== exception
rcu_user_exit()
==== end of exception
==== end of syscall
rcu_user_enter()
This is because when we enter an exception, we don't have a different
entry whenever we trapped/faulted in userspace or kernelspace. So it's hard
to know if we were in userspace before the exception triggered. To avoid
complication in architecture code, I'm using this kind of "in_user" state.
--
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