diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 5a91fe0b5de6..7fd343462597 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -1521,6 +1521,12 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, int sync) | |||
1521 | unsigned long tl = this_load; | 1521 | unsigned long tl = this_load; |
1522 | unsigned long tl_per_task; | 1522 | unsigned long tl_per_task; |
1523 | 1523 | ||
1524 | /* | ||
1525 | * Attract cache-cold tasks on sync wakeups: | ||
1526 | */ | ||
1527 | if (sync && !task_hot(p, rq->clock, this_sd)) | ||
1528 | goto out_set_cpu; | ||
1529 | |||
1524 | schedstat_inc(p, se.nr_wakeups_affine_attempts); | 1530 | schedstat_inc(p, se.nr_wakeups_affine_attempts); |
1525 | tl_per_task = cpu_avg_load_per_task(this_cpu); | 1531 | tl_per_task = cpu_avg_load_per_task(this_cpu); |
1526 | 1532 | ||
@@ -1598,7 +1604,7 @@ out_activate: | |||
1598 | * the waker guarantees that the freshly woken up task is going | 1604 | * the waker guarantees that the freshly woken up task is going |
1599 | * to be considered on this CPU.) | 1605 | * to be considered on this CPU.) |
1600 | */ | 1606 | */ |
1601 | if (!sync || cpu != this_cpu) | 1607 | if (!sync || rq->curr == rq->idle) |
1602 | check_preempt_curr(rq, p); | 1608 | check_preempt_curr(rq, p); |
1603 | success = 1; | 1609 | success = 1; |
1604 | 1610 | ||