On Thu, Aug 30, 2012 at 02:05:28PM -0700, Paul E. McKenney wrote: > From: Frederic Weisbecker <[email protected]> > > When exceptions or irq are about to resume userspace, if > the task needs to be rescheduled, the arch low level code > calls schedule() directly. > > At that time we may be in extended quiescent state from RCU > POV: the exception is not anymore protected inside > rcu_user_exit() - rcu_user_enter() and the irq has called > rcu_irq_exit() already. > > Create a new API schedule_user() that calls schedule() inside > rcu_user_exit()-rcu_user_enter() in order to protect it. Archs > will need to rely on it now to implement user preemption safely. > > Signed-off-by: Frederic Weisbecker <[email protected]> > Cc: Alessio Igor Bogani <[email protected]> > Cc: Andrew Morton <[email protected]> > Cc: Avi Kivity <[email protected]> > Cc: Chris Metcalf <[email protected]> > Cc: Christoph Lameter <[email protected]> > Cc: Geoff Levand <[email protected]> > Cc: Gilad Ben Yossef <[email protected]> > Cc: Hakan Akkan <[email protected]> > Cc: H. Peter Anvin <[email protected]> > Cc: Ingo Molnar <[email protected]> > Cc: Josh Triplett <[email protected]> > Cc: Kevin Hilman <[email protected]> > Cc: Max Krasnyansky <[email protected]> > Cc: Peter Zijlstra <[email protected]> > Cc: Stephen Hemminger <[email protected]> > Cc: Steven Rostedt <[email protected]> > Cc: Sven-Thorsten Dietrich <[email protected]> > Cc: Thomas Gleixner <[email protected]> > Signed-off-by: Paul E. McKenney <[email protected]>
Reviewed-by: Josh Triplett <[email protected]> > kernel/sched/core.c | 7 +++++++ > 1 files changed, 7 insertions(+), 0 deletions(-) > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index 0bd599b..e841dfc 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -3463,6 +3463,13 @@ asmlinkage void __sched schedule(void) > } > EXPORT_SYMBOL(schedule); > > +asmlinkage void __sched schedule_user(void) > +{ > + rcu_user_exit(); > + schedule(); > + rcu_user_enter(); > +} > + > /** > * schedule_preempt_disabled - called with preemption disabled > * > -- > 1.7.8 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

