Re: [PATCH] sched/fair: prefer prev cpu in asymmetric wakeup path

Dietmar Eggemann
2020-10-23T17:15:01Z

On 22/10/2020 17:33, Vincent Guittot wrote:
> On Thu, 22 Oct 2020 at 16:53, Valentin Schneider
> <valentin.schneider@arm.com> wrote:
>>
>>
>> Hi Vincent,
>>
>> On 22/10/20 14:43, Vincent Guittot wrote:

[...]

>>> static int
>>> -select_idle_capacity(struct task_struct *p, struct sched_domain *sd, int target)
>>> +select_idle_capacity(struct task_struct *p, struct sched_domain *sd, int prev, int target)
>>> {
>>> unsigned long best_cap = 0;
>>> int cpu, best_cpu = -1;
>>> @@ -6178,9 +6178,22 @@ select_idle_capacity(struct task_struct *p, struct sched_domain *sd, int target)
>>>
>>> sync_entity_load_avg(&p->se);
>>>
>>> + if ((available_idle_cpu(target) || sched_idle_cpu(target)) &&
>>> + task_fits_capacity(p, capacity_of(target)))
>>> + return target;
>>> +
>>
>> I think we still need to check for CPU affinity here.
>
> yes good point

We don't check CPU affinity on target and prev in the symmetric case.

I always thought that since we:

(1) check 'want_affine = ... && cpumask_test_cpu(cpu, p->cpus_ptr);' in
select_task_rq_fair() and

(2) we have the select_fallback_rq() in select_task_rq() for prev

that this would be sufficient? …