Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269171
b: refs/heads/master
c: 908a328
h: refs/heads/master
i:
  269169: 915bd0c
  269167: 1b1695b
v: v3
  • Loading branch information
Thomas Gleixner authored and Ingo Molnar committed Oct 4, 2011
1 parent 3e9f50b commit 257e0e6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f0f1d32f931b705c4ee5dd374074d34edf3eae14
refs/heads/master: 908a3283728d92df36e0c7cd63304fd35e93a8a9
15 changes: 14 additions & 1 deletion trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -5138,7 +5138,20 @@ EXPORT_SYMBOL(task_nice);
*/
int idle_cpu(int cpu)
{
return cpu_curr(cpu) == cpu_rq(cpu)->idle;
struct rq *rq = cpu_rq(cpu);

if (rq->curr != rq->idle)
return 0;

if (rq->nr_running)
return 0;

#ifdef CONFIG_SMP
if (!llist_empty(&rq->wake_list))
return 0;
#endif

return 1;
}

/**
Expand Down

0 comments on commit 257e0e6

Please sign in to comment.