[Devel,rh7] sched: fair: fix dst pinned not set when failing migration due to cpulimit restriction

Submitted by Vladimir Davydov on Aug. 3, 2016, 1:07 p.m.

Details

Message ID 1470229622-5632-1-git-send-email-vdavydov@virtuozzo.com
State New
Series "sched: fair: fix dst pinned not set when failing migration due to cpulimit restriction"
Headers show

Commit Message

Vladimir Davydov Aug. 3, 2016, 1:07 p.m.
When failing task migration due to cpulimit restriction, we should set
dst pinned flag so that the load balancing procedure will proceed to the
next cpu, just like in case of failing task migration due to affinity
mask (see can_migrate_task). We don't do that since rebase to
3.10.0-327.18.2.el7. Fix that.

Signed-off-by: Vladimir Davydov <vdavydov@virtuozzo.com>
---
 kernel/sched/fair.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index e39ed4c17464..cedd178f963c 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5446,15 +5446,17 @@  static inline int can_migrate_task_cpulimit(struct task_struct *p, struct lb_env
 
 		schedstat_inc(p, se.statistics.nr_failed_migrations_cpulimit);
 
+		env->flags |= LBF_SOME_PINNED;
+
 		if (check_cpulimit_spread(tg, env->src_cpu) != 0)
 			return 0;
 
-		if (!env->dst_grpmask || (env->flags & LBF_SOME_PINNED))
+		if (!env->dst_grpmask || (env->flags & LBF_DST_PINNED))
 			return 0;
 
 		for_each_cpu_and(cpu, env->dst_grpmask, env->cpus) {
 			if (cfs_rq_active(tg->cfs_rq[cpu])) {
-				env->flags |= LBF_SOME_PINNED;
+				env->flags |= LBF_DST_PINNED;
 				env->new_dst_cpu = cpu;
 				break;
 			}