@@ -1706,11 +1706,12 @@ static void set_cpus_allowed_dl(struct task_struct *p,
weight = cpumask_weight(new_mask);
/*
- * Only update if the process changes its state from whether it
- * can migrate or not.
+ * Skip updating the migration stuff if the process doesn't change
+ * its migrate state, but still need to check if it can be pushed
+ * away due to its new affinity.
*/
if ((p->nr_cpus_allowed > 1) == (weight > 1))
- return;
+ goto queue_push;
/*
* The process used to be able to migrate OR it can now migrate
@@ -1727,6 +1728,13 @@ static void set_cpus_allowed_dl(struct task_struct *p,
}
update_dl_migration(&rq->dl);
+
+queue_push:
+ if (weight > 1 &&
+ !task_running(rq, p) &&
+ !test_tsk_need_resched(rq->curr) &&
+ !cpumask_subset(new_mask, &p->cpus_allowed))
+ queue_push_tasks(rq);
}
/* Assumes rq->lock is held */