aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-03-21 07:09:35 -0400
committerIngo Molnar <mingo@elte.hu>2012-03-01 04:28:03 -0500
commitc5491ea779793f977d282754db478157cc409d82 (patch)
treec110f80101e9e513f5a6f1d2ba81b2934c2408f6 /kernel
parent7abc63b1bd412f7655b62ef3e35c3c11c5134636 (diff)
sched/rt: Add schedule_preempt_disabled()
Add helper to get rid of the ever repeating: preempt_enable_no_resched(); schedule(); preempt_disable(); patterns. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/n/tip-wxx7btox7coby6ifv5vzhzgp@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/core.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 91fe6a0e9098..73022395c00e 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3246,6 +3246,18 @@ asmlinkage void __sched schedule(void)
3246} 3246}
3247EXPORT_SYMBOL(schedule); 3247EXPORT_SYMBOL(schedule);
3248 3248
3249/**
3250 * schedule_preempt_disabled - called with preemption disabled
3251 *
3252 * Returns with preemption disabled. Note: preempt_count must be 1
3253 */
3254void __sched schedule_preempt_disabled(void)
3255{
3256 preempt_enable_no_resched();
3257 schedule();
3258 preempt_disable();
3259}
3260
3249#ifdef CONFIG_MUTEX_SPIN_ON_OWNER 3261#ifdef CONFIG_MUTEX_SPIN_ON_OWNER
3250 3262
3251static inline bool owner_running(struct mutex *lock, struct task_struct *owner) 3263static inline bool owner_running(struct mutex *lock, struct task_struct *owner)