Re: [RFC v2 3/7] Improve the tracking of active utilisation

Peter Zijlstra
2016-04-05T18:00:57Z

On Tue, Apr 05, 2016 at 07:56:57PM +0200, luca abeni wrote:
> > > + if (rq != cpu_rq(cpu)) {
> >
> > I don't think this is right, you want:
> >
> > if (task_cpu(p) != cpu) {
> >
> > because @cpu does not need to be task_cpu().
> Uhm... I must have misunderstood something in the code, then :(
> What I want to do here is to check if select_task_rq_dl() selected
> a new CPU for this task... Since at the beginning of the function
> rq is set as
> rq = cpu_rq(cpu);
> I was thinkint about checking if this is still true (if not, it
> means that the value of "cpu" changed).
>
> I'll look at it again.

Basically because:

ac66f5477239 ("sched/numa: Introduce migrate_swap()")

we cannot (in general) assume .cpu == task_cpu(p).

Now it might still be true for deadline tasks, but I find it easier to
simply not rely on such assumptions.