aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 673b588b713b..9ca4a2e6a236 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -642,6 +642,24 @@ static inline void update_rq_clock(struct rq *rq)
642# define const_debug static const 642# define const_debug static const
643#endif 643#endif
644 644
645/**
646 * runqueue_is_locked
647 *
648 * Returns true if the current cpu runqueue is locked.
649 * This interface allows printk to be called with the runqueue lock
650 * held and know whether or not it is OK to wake up the klogd.
651 */
652int runqueue_is_locked(void)
653{
654 int cpu = get_cpu();
655 struct rq *rq = cpu_rq(cpu);
656 int ret;
657
658 ret = spin_is_locked(&rq->lock);
659 put_cpu();
660 return ret;
661}
662
645/* 663/*
646 * Debugging: various feature bits 664 * Debugging: various feature bits
647 */ 665 */