aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 3b27c3a553aa..750612751a7f 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1016,6 +1016,11 @@ task_hot(struct task_struct *p, u64 now, struct sched_domain *sd)
1016 if (p->sched_class != &fair_sched_class) 1016 if (p->sched_class != &fair_sched_class)
1017 return 0; 1017 return 0;
1018 1018
1019 if (sysctl_sched_migration_cost == -1)
1020 return 1;
1021 if (sysctl_sched_migration_cost == 0)
1022 return 0;
1023
1019 delta = now - p->se.exec_start; 1024 delta = now - p->se.exec_start;
1020 1025
1021 return delta < (s64)sysctl_sched_migration_cost; 1026 return delta < (s64)sysctl_sched_migration_cost;
@@ -2189,7 +2194,8 @@ int can_migrate_task(struct task_struct *p, struct rq *rq, int this_cpu,
2189 * 2) too many balance attempts have failed. 2194 * 2) too many balance attempts have failed.
2190 */ 2195 */
2191 2196
2192 if (sd->nr_balance_failed > sd->cache_nice_tries) { 2197 if (!task_hot(p, rq->clock, sd) ||
2198 sd->nr_balance_failed > sd->cache_nice_tries) {
2193#ifdef CONFIG_SCHEDSTATS 2199#ifdef CONFIG_SCHEDSTATS
2194 if (task_hot(p, rq->clock, sd)) { 2200 if (task_hot(p, rq->clock, sd)) {
2195 schedstat_inc(sd, lb_hot_gained[idle]); 2201 schedstat_inc(sd, lb_hot_gained[idle]);