Re: [RFC PATCH v4 00/19] Core scheduling v4

Aubrey Li
2020-02-26T07:22:09Z

On Wed, Feb 26, 2020 at 4:51 AM Vineeth Remanan Pillai
<vpillai@digitalocean.com> wrote:
>
> I have a quick patch
> which might fix this. The idea is that, we allow migration if p's
> hierarchical load or estimated utilization is more than dest_rq->curr.
> While thinking about this fix, I noticed that we are not holding the
> dest_rq lock for any of the migration patches. Migration patches would
> probably need a rework. Attaching my patch down, but it also does not
> take the dest_rq lock. I have also added a case of dest_core being
> forced_idle. I think that would be an opportunity to migrate. Ideally
> we should check if the forced idle task has the same cookie as p.
>
> https://gist.github.com/vineethrp/887743608f42a6ce96bf7847b5b119ae
>

Hi Vineeth,

Thanks for the quick fix. I guess this patch should work for Aaron's case
because it almost removed the cookie checking here. Some comments
below:

+ if (rq->core->core_forceidle)
+ return true;

We check cookie match during load balance to avoid two different
cookie tasks on the same core. If one cpu is forced idle, its sibling should
be running a non-idle task, not sure why we can return true directly here.
And if we need to check cookie, with this forced idle case, why it's special
to be picked up?

+ if (task_h_load(p) > task_h_load(rq->curr))
+ return true;
+ if (task_util_est(p) > task_util_est(rq->curr))
+ return true;

These two need to exclude rq->curr == rq->idle case?
otherwise idle balance always return true?

Thanks,
-Aubrey