Re: [PATCH 2/3] sched,fair: Fix local starvation

From: Mike Galbraith
Date: Sun May 22 2016 - 04:04:57 EST


On Sun, 2016-05-22 at 15:42 +0800, Wanpeng Li wrote:
> 2016-05-22 15:32 GMT+08:00 Mike Galbraith <mgalbraith@xxxxxxx>:
> > On Sun, 2016-05-22 at 15:27 +0800, Wanpeng Li wrote:
> >
> > > What's the meaning of 'x-cpu wakeup'? ;-)
> >
> > Generally, cross CPU, as in waker/wakee reside on different CPUs,
> > but
> > in this case, it's cross socket wakeup.
>
> Do you mean wakeup wakees on remote socket don't imply
> migration/normalized, why?

Because the wakee is NOT necessarily migrated simply because it lives
in some remote cache domain. It was a simple but nasty booboo.

ttwu():
cpu = select_task_rq(p, p->wake_cpu, SD_BALANCE_WAKE, wake_flags);
if (task_cpu(p) != cpu) {
wake_flags |= WF_MIGRATED;
set_task_cpu(p, cpu);

set_task_cpu():
if (task_cpu(p) != new_cpu) {
if (p->sched_class->migrate_task_rq)
p->sched_class->migrate_task_rq(p);
^^^^^^^^^^^^^^^^^^

migrate_task_rq_fair() normalizes wakee, those wakees that did not
migrate have NOT been normalized, leaving two flavors of wakee on the
wake_list, with no discriminator. Store class information internally,
and the x-socket information disconnect evaporates.

-Mike