Re: [PATCH v4 04/10] sched/fair: Dynamically update cfs_overload_cpus

From: Valentin Schneider
Date: Sat Dec 08 2018 - 13:47:21 EST


On 07/12/2018 22:35, Steven Sistare wrote:
[...]
>>> @@ -4468,8 +4495,12 @@ static void throttle_cfs_rq(struct cfs_rq *cfs_rq)
>>> dequeue = 0;
>>> }
>>>
>>> - if (!se)
>>> + if (!se) {
>>> sub_nr_running(rq, task_delta);
>>> + if (prev_nr >= 2 && prev_nr - task_delta < 2)
>>> + overload_clear(rq);
>>> +
>>> + }
>>
>> Eventually it'd be nice to squash those into {add, sub}_nr_running(), but
>> you already mentioned wanting to stick to CFS for now, so I don't think
>> it's *too* much of a big deal.
>
> Maybe. It depends on a design decision to be made if/when we add bitmap
> based stealing to other scheduling classes. Do we maintain one bitmap
> for overloaded CPUs where the overload may be caused by any mix of different
> task classes? If yes, then the bitmap search for one class such as RT
> will inspect and reject overloaded CPUs that only have CFS tasks, which
> making the search less efficient. I am leaning towards a separate bitmap
> per class to avoid that.
>

Didn't ponder too much about it, but a bitmap per class sounds sane. My
comment was mostly about saving ourselves the need to decorate every
{add, sub}_nr_running() call with overload_{set, clear}() calls.

> - Steve
>
>