[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <63631321-3e25-913e-a061-9ff65c98b76b@linux.alibaba.com>
Date: Wed, 11 Mar 2020 11:12:07 +0800
From: ηθ΄ <yun.wang@...ux.alibaba.com>
To: Vincent Guittot <vincent.guittot@...aro.org>
Cc: Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
"open list:SCHEDULER" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] sched: avoid scale real weight down to zero
On 2020/3/6 δΈε11:06, Vincent Guittot wrote:
[snip]
>>
>> Thus when scale_load_down() scale real weight down to 0, it's no
>> longer telling the real story, the caller will have the wrong
>> information and the calculation will be buggy.
>>
>> This patch add check in scale_load_down(), so the real weight will
>> be >= MIN_SHARES after scale, after applied the group C wins as
>> expected.
>>
>> Cc: Ben Segall <bsegall@...gle.com>
>> Cc: Vincent Guittot <vincent.guittot@...aro.org>
>> Suggested-by: Peter Zijlstra <peterz@...radead.org>
>> Signed-off-by: Michael Wang <yun.wang@...ux.alibaba.com>
>
> Reviewed-by: Vincent Guittot <vincent.guittot@...aro.org>
Thanks for the review :-)
Hi Peter, should we apply this one?
Regards,
Michael Wang
>> ---
>> kernel/sched/sched.h | 8 +++++++-
>> 1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
>> index 2a0caf394dd4..75c283f22256 100644
>> --- a/kernel/sched/sched.h
>> +++ b/kernel/sched/sched.h
>> @@ -118,7 +118,13 @@ extern long calc_load_fold_active(struct rq *this_rq, long adjust);
>> #ifdef CONFIG_64BIT
>> # define NICE_0_LOAD_SHIFT (SCHED_FIXEDPOINT_SHIFT + SCHED_FIXEDPOINT_SHIFT)
>> # define scale_load(w) ((w) << SCHED_FIXEDPOINT_SHIFT)
>> -# define scale_load_down(w) ((w) >> SCHED_FIXEDPOINT_SHIFT)
>> +# define scale_load_down(w) \
>> +({ \
>> + unsigned long __w = (w); \
>> + if (__w) \
>> + __w = max(MIN_SHARES, __w >> SCHED_FIXEDPOINT_SHIFT); \
>> + __w; \
>> +})
>> #else
>> # define NICE_0_LOAD_SHIFT (SCHED_FIXEDPOINT_SHIFT)
>> # define scale_load(w) (w)
>> --
>> 2.14.4.44.g2045bb6
>>
Powered by blists - more mailing lists