aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/sched.h1
-rw-r--r--kernel/sched/core.c12
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);
361extern signed long schedule_timeout_killable(signed long timeout); 361extern signed long schedule_timeout_killable(signed long timeout);
362extern signed long schedule_timeout_uninterruptible(signed long timeout); 362extern signed long schedule_timeout_uninterruptible(signed long timeout);
363asmlinkage void schedule(void); 363asmlinkage void schedule(void);
364extern void schedule_preempt_disabled(void);
364extern int mutex_spin_on_owner(struct mutex *lock, struct task_struct *owner); 365extern int mutex_spin_on_owner(struct mutex *lock, struct task_struct *owner);
365 366
366struct nsproxy; 367struct 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}
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)