diff options
-rw-r--r-- | include/linux/sched.h | 1 | ||||
-rw-r--r-- | kernel/sched/core.c | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 1a6398424fab..03dd224d0667 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -361,6 +361,7 @@ extern signed long schedule_timeout_interruptible(signed long timeout); | |||
361 | extern signed long schedule_timeout_killable(signed long timeout); | 361 | extern signed long schedule_timeout_killable(signed long timeout); |
362 | extern signed long schedule_timeout_uninterruptible(signed long timeout); | 362 | extern signed long schedule_timeout_uninterruptible(signed long timeout); |
363 | asmlinkage void schedule(void); | 363 | asmlinkage void schedule(void); |
364 | extern void schedule_preempt_disabled(void); | ||
364 | extern int mutex_spin_on_owner(struct mutex *lock, struct task_struct *owner); | 365 | extern int mutex_spin_on_owner(struct mutex *lock, struct task_struct *owner); |
365 | 366 | ||
366 | struct nsproxy; | 367 | struct nsproxy; |
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 | } |
3247 | EXPORT_SYMBOL(schedule); | 3247 | EXPORT_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 | */ | ||
3254 | void __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 | ||
3251 | static inline bool owner_running(struct mutex *lock, struct task_struct *owner) | 3263 | static inline bool owner_running(struct mutex *lock, struct task_struct *owner) |