[PATCH] sched/pelt: Fix bracket typo

Steven Lung posted 1 patch 3 years, 10 months ago
kernel/sched/pelt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] sched/pelt: Fix bracket typo
Posted by Steven Lung 3 years, 10 months ago
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
Re: [PATCH] sched/pelt: Fix bracket typo
Posted by Randy Dunlap 3 years, 10 months ago

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
Re: [PATCH] sched/pelt: Fix bracket typo
Posted by 龍帆軒 3 years, 10 months ago
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
Re: [PATCH] sched/pelt: Fix bracket typo
Posted by Peter Zijlstra 3 years, 10 months ago
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.