[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <746d2b82-fb39-1412-0dc3-c5ff10b578ec@linux.alibaba.com>
Date: Fri, 6 Mar 2020 17:34:53 +0800
From: 王贇 <yun.wang@...ux.alibaba.com>
To: Vincent Guittot <vincent.guittot@...aro.org>
Cc: Ben Segall <bsegall@...gle.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Mel Gorman <mgorman@...e.de>,
"open list:SCHEDULER" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH] sched: fix the nonsense shares when load of cfs_rq is
too, small
On 2020/3/6 下午4:04, Vincent Guittot wrote:
> On Fri, 6 Mar 2020 at 05:23, 王贇 <yun.wang@...ux.alibaba.com> wrote:
>>
>>
>>
>> On 2020/3/5 下午3:53, Vincent Guittot wrote:
>>> On Thu, 5 Mar 2020 at 02:14, 王贇 <yun.wang@...ux.alibaba.com> wrote:
>> [snip]
>>>>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>>>>> index fcc968669aea..6d7a9d72d742 100644
>>>>> --- a/kernel/sched/fair.c
>>>>> +++ b/kernel/sched/fair.c
>>>>> @@ -3179,9 +3179,9 @@ static long calc_group_shares(struct cfs_rq *cfs_rq)
>>>>> long tg_weight, tg_shares, load, shares;
>>>>> struct task_group *tg = cfs_rq->tg;
>>>>>
>>>>> - tg_shares = READ_ONCE(tg->shares);
>>>>> + tg_shares = scale_load_down(READ_ONCE(tg->shares));
>>>>>
>>>>> - load = max(scale_load_down(cfs_rq->load.weight), cfs_rq->avg.load_avg);
>>>>> + load = max(cfs_rq->load.weight, scale_load(cfs_rq->avg.load_avg));
>>>>>
>>>>> tg_weight = atomic_long_read(&tg->load_avg);
>>>>
>>>> Get the point, but IMHO fix scale_load_down() sounds better, to
>>>> cover all the similar cases, let's first try that way see if it's
>>>> working :-)
>>>
>>> The problem with this solution is that the avg.load_avg of gse or
>>> cfs_rq might stay to 0 because it uses
>>> scale_load_down(se/cfs_rq->load.weight)
>>
>> Will cfs_rq->load.weight be zero too without scale down?
>
> cfs_rq->load.weight will never be 0, it's min is 2
>
>>
>> If cfs_rq->load.weight got at least something, the load will not be
>> zero after pick the max, correct?
>
> But the cfs_rq->avg.load_avg will never be other than 0 what ever
> there are heavy or light tasks in the group
Aha, get the point now :-)
BTW, would you like to give a review on
[PATCH] sched: avoid scale real weight down to zero
please?
Regards,
Michael Wang
>
>>
>> Regards,
>> Michael Wang
>>
>>>
>>>>
>>>> Regards,
>>>> Michael Wang
>>>>
>>>>>
>>>>>
>>>>>
Powered by blists - more mailing lists