From: Frederic Weisbecker Date: Wed, 11 Jul 2012 18:26:37 +0000 (+0200) Subject: rcu: Exit RCU extended QS on user preemption X-Git-Tag: next-20120816~27^2^5~3 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=01883421d3614e567561f057dcd330d206667fa3;p=karo-tx-linux.git rcu: Exit RCU extended QS on user preemption 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 Cc: Alessio Igor Bogani Cc: Andrew Morton Cc: Avi Kivity Cc: Chris Metcalf Cc: Christoph Lameter Cc: Geoff Levand Cc: Gilad Ben Yossef Cc: Hakan Akkan Cc: H. Peter Anvin Cc: Ingo Molnar Cc: Josh Triplett Cc: Kevin Hilman Cc: Max Krasnyansky Cc: Peter Zijlstra Cc: Stephen Hemminger Cc: Steven Rostedt Cc: Sven-Thorsten Dietrich Cc: Thomas Gleixner Signed-off-by: Paul E. McKenney --- diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 1e0fa5b76029..a37619a3824b 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3332,6 +3332,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 *