aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 1874c7418319..4cdc91cf48f6 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -5138,7 +5138,20 @@ EXPORT_SYMBOL(task_nice);
5138 */ 5138 */
5139int idle_cpu(int cpu) 5139int idle_cpu(int cpu)
5140{ 5140{
5141 return cpu_curr(cpu) == cpu_rq(cpu)->idle; 5141 struct rq *rq = cpu_rq(cpu);
5142
5143 if (rq->curr != rq->idle)
5144 return 0;
5145
5146 if (rq->nr_running)
5147 return 0;
5148
5149#ifdef CONFIG_SMP
5150 if (!llist_empty(&rq->wake_list))
5151 return 0;
5152#endif
5153
5154 return 1;
5142} 5155}
5143 5156
5144/** 5157/**