Skip to content

Commit

Permalink
sched: Do not consider SCHED_IDLE tasks to be cache hot
Browse files Browse the repository at this point in the history
This patch adds a check in task_hot to return if the task has SCHED_IDLE
policy. SCHED_IDLE tasks have very low weight, and when run with regular
workloads, are typically scheduled many milliseconds apart. There is no
need to consider these tasks hot for load balancing.

Signed-off-by: Nikhil Rao <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Nikhil Rao authored and Ingo Molnar committed Oct 18, 2010
1 parent 17bdcf9 commit ef8002f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -2025,6 +2025,9 @@ task_hot(struct task_struct *p, u64 now, struct sched_domain *sd)
if (p->sched_class != &fair_sched_class)
return 0;

if (unlikely(p->policy == SCHED_IDLE))
return 0;

/*
* Buddy candidates are cache hot:
*/
Expand Down

0 comments on commit ef8002f

Please sign in to comment.