aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/sched.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 489e7d926408..d2dfe4c1a225 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3002,6 +3002,7 @@ int can_migrate_task(struct task_struct *p, struct rq *rq, int this_cpu,
3002 struct sched_domain *sd, enum cpu_idle_type idle, 3002 struct sched_domain *sd, enum cpu_idle_type idle,
3003 int *all_pinned) 3003 int *all_pinned)
3004{ 3004{
3005 int tsk_cache_hot = 0;
3005 /* 3006 /*
3006 * We do not migrate tasks that are: 3007 * We do not migrate tasks that are:
3007 * 1) running (obviously), or 3008 * 1) running (obviously), or
@@ -3025,10 +3026,11 @@ int can_migrate_task(struct task_struct *p, struct rq *rq, int this_cpu,
3025 * 2) too many balance attempts have failed. 3026 * 2) too many balance attempts have failed.
3026 */ 3027 */
3027 3028
3028 if (!task_hot(p, rq->clock, sd) || 3029 tsk_cache_hot = task_hot(p, rq->clock, sd);
3029 sd->nr_balance_failed > sd->cache_nice_tries) { 3030 if (!tsk_cache_hot ||
3031 sd->nr_balance_failed > sd->cache_nice_tries) {
3030#ifdef CONFIG_SCHEDSTATS 3032#ifdef CONFIG_SCHEDSTATS
3031 if (task_hot(p, rq->clock, sd)) { 3033 if (tsk_cache_hot) {
3032 schedstat_inc(sd, lb_hot_gained[idle]); 3034 schedstat_inc(sd, lb_hot_gained[idle]);
3033 schedstat_inc(p, se.nr_forced_migrations); 3035 schedstat_inc(p, se.nr_forced_migrations);
3034 } 3036 }
@@ -3036,7 +3038,7 @@ int can_migrate_task(struct task_struct *p, struct rq *rq, int this_cpu,
3036 return 1; 3038 return 1;
3037 } 3039 }
3038 3040
3039 if (task_hot(p, rq->clock, sd)) { 3041 if (tsk_cache_hot) {
3040 schedstat_inc(p, se.nr_failed_migrations_hot); 3042 schedstat_inc(p, se.nr_failed_migrations_hot);
3041 return 0; 3043 return 0;
3042 } 3044 }