Commit bbba26eb authored by Philippe Gerum's avatar Philippe Gerum

sched: ipipe: announce CPU affinity change

Emit IPIPE_KEVT_SETAFFINITY to the co-kernel when the target task is
about to move to another CPU.

CPU migration can only take place from the root domain, the pipeline
does not provide any support for migrating tasks from the head domain,
and derives several key assumptions based on this invariant.
parent cfe28fb1
......@@ -1094,10 +1094,13 @@ static int __set_cpus_allowed_ptr(struct task_struct *p,
}
/* Can the task run on the task's current CPU? If so, we're done */
if (cpumask_test_cpu(task_cpu(p), new_mask))
if (cpumask_test_cpu(task_cpu(p), new_mask)) {
__ipipe_report_setaffinity(p, task_cpu(p));
goto out;
}
dest_cpu = cpumask_any_and(cpu_valid_mask, new_mask);
__ipipe_report_setaffinity(p, dest_cpu);
if (task_running(rq, p) || p->state == TASK_WAKING) {
struct migration_arg arg = { p, dest_cpu };
/* Need help from migration thread: drop lock and wait. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment