All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched/pelt: Fix bracket typo
@ 2022-06-08 15:00 Steven Lung
  2022-06-08 15:33 ` Randy Dunlap
  0 siblings, 1 reply; 7+ messages in thread
From: Steven Lung @ 2022-06-08 15:00 UTC (permalink / raw)
  To: mingo
  Cc: peterz, juri.lelli, vincent.guittot, dietmar.eggemann, rostedt,
	bsegall, mgorman, bristot, vschneid, linux-kernel, 1030steven

The second bracket describing the range is inverted, this patch
will fix it.

Signed-off-by: Steven Lung <1030steven@gmail.com>
---
 kernel/sched/pelt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c
index 0f3107682..ed82cfba9 100644
--- a/kernel/sched/pelt.c
+++ b/kernel/sched/pelt.c
@@ -233,7 +233,7 @@ ___update_load_sum(u64 now, struct sched_avg *sa,
  * When syncing *_avg with *_sum, we must take into account the current
  * position in the PELT segment otherwise the remaining part of the segment
  * will be considered as idle time whereas it's not yet elapsed and this will
- * generate unwanted oscillation in the range [1002..1024[.
+ * generate unwanted oscillation in the range [1002..1024].
  *
  * The max value of *_sum varies with the position in the time segment and is
  * equals to :
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] sched/pelt: Fix bracket typo
  2022-06-08 15:00 [PATCH] sched/pelt: Fix bracket typo Steven Lung
@ 2022-06-08 15:33 ` Randy Dunlap
  2022-06-08 17:24   ` 龍帆軒
       [not found]   ` <F0C192DB-6043-4629-A009-DCB4BA33A9A9@gmail.com>
  0 siblings, 2 replies; 7+ messages in thread
From: Randy Dunlap @ 2022-06-08 15:33 UTC (permalink / raw)
  To: Steven Lung, mingo
  Cc: peterz, juri.lelli, vincent.guittot, dietmar.eggemann, rostedt,
	bsegall, mgorman, bristot, vschneid, linux-kernel



On 6/8/22 08:00, Steven Lung wrote:
> The second bracket describing the range is inverted, this patch
> will fix it.
> 
> Signed-off-by: Steven Lung <1030steven@gmail.com>
> ---
>  kernel/sched/pelt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c
> index 0f3107682..ed82cfba9 100644
> --- a/kernel/sched/pelt.c
> +++ b/kernel/sched/pelt.c
> @@ -233,7 +233,7 @@ ___update_load_sum(u64 now, struct sched_avg *sa,
>   * When syncing *_avg with *_sum, we must take into account the current
>   * position in the PELT segment otherwise the remaining part of the segment
>   * will be considered as idle time whereas it's not yet elapsed and this will
> - * generate unwanted oscillation in the range [1002..1024[.

Is the above the same as                   range [1002..1024).
?  I.e. 1002-1023 inclusive (or 1024 excluded)?

> + * generate unwanted oscillation in the range [1002..1024].
>   *
>   * The max value of *_sum varies with the position in the time segment and is
>   * equals to :

-- 
~Randy

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] sched/pelt: Fix bracket typo
  2022-06-08 15:33 ` Randy Dunlap
@ 2022-06-08 17:24   ` 龍帆軒
  2022-06-08 19:27     ` Peter Zijlstra
       [not found]   ` <F0C192DB-6043-4629-A009-DCB4BA33A9A9@gmail.com>
  1 sibling, 1 reply; 7+ messages in thread
From: 龍帆軒 @ 2022-06-08 17:24 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, Benjamin Segall, mgorman, bristot, vschneid,
	linux-kernel

On Wed, Jun 8, 2022 at 11:33 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
>
>
> On 6/8/22 08:00, Steven Lung wrote:
> > The second bracket describing the range is inverted, this patch
> > will fix it.
> >
> > Signed-off-by: Steven Lung <1030steven@gmail.com>
> > ---
> >  kernel/sched/pelt.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c
> > index 0f3107682..ed82cfba9 100644
> > --- a/kernel/sched/pelt.c
> > +++ b/kernel/sched/pelt.c
> > @@ -233,7 +233,7 @@ ___update_load_sum(u64 now, struct sched_avg *sa,
> >   * When syncing *_avg with *_sum, we must take into account the current
> >   * position in the PELT segment otherwise the remaining part of the segment
> >   * will be considered as idle time whereas it's not yet elapsed and this will
> > - * generate unwanted oscillation in the range [1002..1024[.
>
> Is the above the same as                   range [1002..1024).
> ?  I.e. 1002-1023 inclusive (or 1024 excluded)?
>
> > + * generate unwanted oscillation in the range [1002..1024].
> >   *
> >   * The max value of *_sum varies with the position in the time segment and is
> >   * equals to :
>
> --
> ~Randy

In the patch that the author submitted[1] for this comment, he
mentioned that the value 1024 can be obtained.
So I think we should use brackets instead of parenthesis.

[1]: https://lore.kernel.org/all/20200506155301.14288-1-vincent.guittot@linaro.org/T/#u

--
Steven

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] sched/pelt: Fix bracket typo
       [not found]   ` <F0C192DB-6043-4629-A009-DCB4BA33A9A9@gmail.com>
@ 2022-06-08 18:41     ` Randy Dunlap
  2022-06-08 20:14     ` Vincent Guittot
  1 sibling, 0 replies; 7+ messages in thread
From: Randy Dunlap @ 2022-06-08 18:41 UTC (permalink / raw)
  To: 龍帆軒
  Cc: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman, bristot, vschneid, linux-kernel


On 6/8/22 09:30, 龍帆軒 wrote:
> 
>> Randy Dunlap <rdunlap@infradead.org <mailto:rdunlap@infradead.org>> 於 2022年6月8日 下午11:33 寫道:
>>
>>
>>
>> On 6/8/22 08:00, Steven Lung wrote:
>>> The second bracket describing the range is inverted, this patch
>>> will fix it.
>>>
>>> Signed-off-by: Steven Lung <1030steven@gmail.com <mailto:1030steven@gmail.com>>
>>> ---
>>> kernel/sched/pelt.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c
>>> index 0f3107682..ed82cfba9 100644
>>> --- a/kernel/sched/pelt.c
>>> +++ b/kernel/sched/pelt.c
>>> @@ -233,7 +233,7 @@ ___update_load_sum(u64 now, struct sched_avg *sa,
>>>  * When syncing *_avg with *_sum, we must take into account the current
>>>  * position in the PELT segment otherwise the remaining part of the segment
>>>  * will be considered as idle time whereas it's not yet elapsed and this will
>>> - * generate unwanted oscillation in the range [1002..1024[.
>>
>> Is the above the same as                   range [1002..1024).
>> ?  I.e. 1002-1023 inclusive (or 1024 excluded)?
>>
>>> + * generate unwanted oscillation in the range [1002..1024].
>>>  *
>>>  * The max value of *_sum varies with the position in the time segment and is
>>>  * equals to :
>>
>> -- 
>> ~Randy
> 
> In the patch that the author submitted[1] for this comment, he mentioned that the value 1024 can be obtained. 
> So I think we should use brackets instead of parenthesis.
> 
> [1]: https://lore.kernel.org/all/20200506155301.14288-1-vincent.guittot@linaro.org/T/#u <https://lore.kernel.org/all/20200506155301.14288-1-vincent.guittot@linaro.org/T/#u>

OK, thanks for the link.

-- 
~Randy

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] sched/pelt: Fix bracket typo
  2022-06-08 17:24   ` 龍帆軒
@ 2022-06-08 19:27     ` Peter Zijlstra
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Zijlstra @ 2022-06-08 19:27 UTC (permalink / raw)
  To: 龍帆軒
  Cc: Randy Dunlap, mingo, juri.lelli, vincent.guittot,
	dietmar.eggemann, rostedt, Benjamin Segall, mgorman, bristot,
	vschneid, linux-kernel

On Thu, Jun 09, 2022 at 01:24:45AM +0800, 龍帆軒 wrote:
> On Wed, Jun 8, 2022 at 11:33 PM Randy Dunlap <rdunlap@infradead.org> wrote:
> >
> >
> >
> > On 6/8/22 08:00, Steven Lung wrote:
> > > The second bracket describing the range is inverted, this patch
> > > will fix it.
> > >
> > > Signed-off-by: Steven Lung <1030steven@gmail.com>
> > > ---
> > >  kernel/sched/pelt.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c
> > > index 0f3107682..ed82cfba9 100644
> > > --- a/kernel/sched/pelt.c
> > > +++ b/kernel/sched/pelt.c
> > > @@ -233,7 +233,7 @@ ___update_load_sum(u64 now, struct sched_avg *sa,
> > >   * When syncing *_avg with *_sum, we must take into account the current
> > >   * position in the PELT segment otherwise the remaining part of the segment
> > >   * will be considered as idle time whereas it's not yet elapsed and this will
> > > - * generate unwanted oscillation in the range [1002..1024[.
> >
> > Is the above the same as                   range [1002..1024).
> > ?  I.e. 1002-1023 inclusive (or 1024 excluded)?

> In the patch that the author submitted[1] for this comment, he
> mentioned that the value 1024 can be obtained.
> So I think we should use brackets instead of parenthesis.

Yeah, IIRC the value is fundamentally [0,1] (*scale) there. Therefore
the patch as proposed makes sense to me.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] sched/pelt: Fix bracket typo
       [not found]   ` <F0C192DB-6043-4629-A009-DCB4BA33A9A9@gmail.com>
  2022-06-08 18:41     ` Randy Dunlap
@ 2022-06-08 20:14     ` Vincent Guittot
  2022-06-08 23:12       ` Steven Lung
  1 sibling, 1 reply; 7+ messages in thread
From: Vincent Guittot @ 2022-06-08 20:14 UTC (permalink / raw)
  To: 龍帆軒
  Cc: Randy Dunlap, mingo, peterz, juri.lelli, dietmar.eggemann,
	rostedt, bsegall, mgorman, bristot, vschneid, linux-kernel

On Wed, 8 Jun 2022 at 18:30, 龍帆軒 <1030steven@gmail.com> wrote:
>
>
> Randy Dunlap <rdunlap@infradead.org> 於 2022年6月8日 下午11:33 寫道:
>
>
>
> On 6/8/22 08:00, Steven Lung wrote:
>
> The second bracket describing the range is inverted, this patch
> will fix it.
>
> Signed-off-by: Steven Lung <1030steven@gmail.com>
> ---
> kernel/sched/pelt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c
> index 0f3107682..ed82cfba9 100644
> --- a/kernel/sched/pelt.c
> +++ b/kernel/sched/pelt.c
> @@ -233,7 +233,7 @@ ___update_load_sum(u64 now, struct sched_avg *sa,
>  * When syncing *_avg with *_sum, we must take into account the current
>  * position in the PELT segment otherwise the remaining part of the segment
>  * will be considered as idle time whereas it's not yet elapsed and this will
> - * generate unwanted oscillation in the range [1002..1024[.
>
>
> Is the above the same as                   range [1002..1024).
> ?  I.e. 1002-1023 inclusive (or 1024 excluded)?

yes, 1024 was excluded from the range because we reached 1024 when
period_contrib == 1024 but when period_contrib == 1024 we decayed and
period_contrib becomes 0 and the load_avg went down to 1002.

Before the changes, the load_avg  for default weight was
1024*(LOAD_AVG_MAX-1024+period_contrib)/LOAD_AVG_MAX
if period_contrib == 0 ie the beg of the window we've got a load_avg of 1002
if period_contrib == 1023 ie the end of the window we've got a load of
int(1023.97)==1023

In French, we use [1002..1024[ but english version is [1002..1024)

>
> + * generate unwanted oscillation in the range [1002..1024].
>  *
>  * The max value of *_sum varies with the position in the time segment and is
>  * equals to :
>
>
> --
> ~Randy
>
>
> In the patch that the author submitted[1] for this comment, he mentioned that the value 1024 can be obtained.
> So I think we should use brackets instead of parenthesis.
>
> [1]: https://lore.kernel.org/all/20200506155301.14288-1-vincent.guittot@linaro.org/T/#u
>
> --
> Steven
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] sched/pelt: Fix bracket typo
  2022-06-08 20:14     ` Vincent Guittot
@ 2022-06-08 23:12       ` Steven Lung
  0 siblings, 0 replies; 7+ messages in thread
From: Steven Lung @ 2022-06-08 23:12 UTC (permalink / raw)
  To: Vincent Guittot
  Cc: Randy Dunlap, mingo, peterz, juri.lelli, dietmar.eggemann,
	rostedt, bsegall, mgorman, bristot, vschneid, linux-kernel

On Wed, Jun 08, 2022 at 10:14:06PM +0200, Vincent Guittot wrote:
> On Wed, 8 Jun 2022 at 18:30, 龍帆軒 <1030steven@gmail.com> wrote:
> >
> >
> > Randy Dunlap <rdunlap@infradead.org> 於 2022年6月8日 下午11:33 寫道:
> >
> >
> >
> > On 6/8/22 08:00, Steven Lung wrote:
> >
> > The second bracket describing the range is inverted, this patch
> > will fix it.
> >
> > Signed-off-by: Steven Lung <1030steven@gmail.com>
> > ---
> > kernel/sched/pelt.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c
> > index 0f3107682..ed82cfba9 100644
> > --- a/kernel/sched/pelt.c
> > +++ b/kernel/sched/pelt.c
> > @@ -233,7 +233,7 @@ ___update_load_sum(u64 now, struct sched_avg *sa,
> >  * When syncing *_avg with *_sum, we must take into account the current
> >  * position in the PELT segment otherwise the remaining part of the segment
> >  * will be considered as idle time whereas it's not yet elapsed and this will
> > - * generate unwanted oscillation in the range [1002..1024[.
> >
> >
> > Is the above the same as                   range [1002..1024).
> > ?  I.e. 1002-1023 inclusive (or 1024 excluded)?
> 
> yes, 1024 was excluded from the range because we reached 1024 when
> period_contrib == 1024 but when period_contrib == 1024 we decayed and
> period_contrib becomes 0 and the load_avg went down to 1002.
> 
> Before the changes, the load_avg  for default weight was
> 1024*(LOAD_AVG_MAX-1024+period_contrib)/LOAD_AVG_MAX
> if period_contrib == 0 ie the beg of the window we've got a load_avg of 1002
> if period_contrib == 1023 ie the end of the window we've got a load of
> int(1023.97)==1023
> 
> In French, we use [1002..1024[ but english version is [1002..1024)

Seems this patch should not be applied, thank Vincent for the explanation.

> 
> >
> > + * generate unwanted oscillation in the range [1002..1024].
> >  *
> >  * The max value of *_sum varies with the position in the time segment and is
> >  * equals to :
> >
> >
> > --
> > ~Randy
> >
> >
> > In the patch that the author submitted[1] for this comment, he mentioned that the value 1024 can be obtained.
> > So I think we should use brackets instead of parenthesis.
> >
> > [1]: https://lore.kernel.org/all/20200506155301.14288-1-vincent.guittot@linaro.org/T/#u
> >
> > --
> > Steven
> >

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-06-08 23:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 15:00 [PATCH] sched/pelt: Fix bracket typo Steven Lung
2022-06-08 15:33 ` Randy Dunlap
2022-06-08 17:24   ` 龍帆軒
2022-06-08 19:27     ` Peter Zijlstra
     [not found]   ` <F0C192DB-6043-4629-A009-DCB4BA33A9A9@gmail.com>
2022-06-08 18:41     ` Randy Dunlap
2022-06-08 20:14     ` Vincent Guittot
2022-06-08 23:12       ` Steven Lung

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.