lkml.org 
[lkml]   [2022]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sched/pelt: simplify load_sum assignment code in attach_entity_load_avg()


On Jun 22 2022, at 11:49 pm, Zackary Liu <zackary.liu.pro@gmail.com> wrote:

> On Jun 22 2022, at 11:20 pm, Vincent Guittot
> <vincent.guittot@linaro.org> wrote:
>
>> On Tue, 21 Jun 2022 at 17:45, Zhaoyu Liu <zackary.liu.pro@gmail.com> wrote:
>>>
>>> In commit 40f5aa4c5eae ("sched/pelt: Fix attach_entity_load_avg()
>>> corner case"),
>>> these code was committed:
>>> if (se_weight(se) < se->avg.load_sum)
>>> se->avg.load_sum = div_u64(se->avg.load_sum, se_weight(se));
>>> else
>>> se->avg.load_sum = 1;
>>>
>>> they could be replace with:
>>> se->avg.load_sum = div_u64(se->avg.load_sum, se_weight(se))
>>> ?: 1;
>>>
>>> to make the code cleaner.
>>
>> This quite subjective as I consider current version cleaner than your proposal
>
> Thanks for your reply, vincent
>
> Perhaps, this code is more concise, and this form can exist in many
> places in the kernel, and can be searched with 'grep "?: 1;" -nR kernel'
>
> --
> zackary

I have sent a patch couple days ago but still i don't get the reply,
I am looking forward to your reply,
thank you

--
zackary

\
 
 \ /
  Last update: 2022-07-15 16:34    [W:0.071 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site