Re: [RFC PATCH] sched: fix the nonsense shares when load of cfs_rq is too, small

From: çè
Date: Tue Mar 10 2020 - 04:15:29 EST




On 2020/3/10 äå3:57, Vincent Guittot wrote:
[snip]
>>> That being said, having a min of 2 for scale_load_down will enable us
>>> to have the tg->load_avg != 0 so a tg_weight != 0 and each sched group
>>> will not have the full shares. But it will make those group completely
>>> fair anyway.
>>> The best solution would be not to scale down the weight but that's a
>>> bigger change
>>
>> Does that means a changing for all those 'load.weight' related
>> calculation, to reserve the scaled weight?
>
> yes, to make sure that calculation still fit in the variable
>
>>
>> I suppose u64 is capable for 'cfs_rq.load' to reserve the scaled up load,
>> changing all those places could be annoying but still fine.
>
> it's fine but the max number of runnable tasks at the max priority on
> a cfs_rq will decrease from around 4 billion to "only" 4 Million.
>
>>
>> However, I'm not quite sure about the benefit, how much more precision
>> we'll gain and does that really matters? better to have some testing to
>> demonstrate it.
>
> it will ensure a better fairness in a larger range of share value. I
> agree that we can wonder if it's worth the effort for those low share
> values. Wouldbe interesting to knwo who use such low value and for
> which purpose

AFAIK, the k8s stuff will use share 2 for the Best Effort type of Pods,
but that's just because they want them run only when there are no other
Pods want running, won't dealing with multiple shares under 1024 and
desire good precision I suppose.

Regards,
Michael Wang

>
> Regards,
> Vincent
>>
>> Regards,
>> Michael Wang
>>
>>
>>>