lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 15 Sep 2018 14:17:09 +0200
From:   Vincent Guittot <vincent.guittot@...aro.org>
To:     Ingo Molnar <mingo@...nel.org>
Cc:     Ingo Molnar <mingo@...hat.com>,
        viresh kumar <viresh.kumar@...aro.org>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        "H. Peter Anvin" <hpa@...or.com>,
        linux-tip-commits@...r.kernel.org, douly.fnst@...fujitsu.com,
        Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
Subject: Re: [tip:sched/core] sched/fair: Remove #ifdefs from scale_rt_capacity()

Hi Ingo,

On Sat, 15 Sep 2018 at 13:47, Ingo Molnar <mingo@...nel.org> wrote:
>
>
> * tip-bot for Vincent Guittot <tipbot@...or.com> wrote:
>
> > Commit-ID:  2e62c4743adc4c7bfcbc1f45118fc7bec58cf30a
> > Gitweb:     https://git.kernel.org/tip/2e62c4743adc4c7bfcbc1f45118fc7bec58cf30a
> > Author:     Vincent Guittot <vincent.guittot@...aro.org>
> > AuthorDate: Thu, 19 Jul 2018 14:00:06 +0200
> > Committer:  Ingo Molnar <mingo@...nel.org>
> > CommitDate: Wed, 25 Jul 2018 11:41:05 +0200
> >
> > sched/fair: Remove #ifdefs from scale_rt_capacity()
> >
> > Reuse cpu_util_irq() that has been defined for schedutil and set irq util
> > to 0 when !CONFIG_IRQ_TIME_ACCOUNTING.
> >
> > But the compiler is not able to optimize the sequence (at least with
> > aarch64 GCC 7.2.1):
> >
> >       free *= (max - irq);
> >       free /= max;
> >
> > when irq is fixed to 0
> >
> > Add a new inline function scale_irq_capacity() that will scale utilization
> > when irq is accounted. Reuse this funciton in schedutil which applies
> > similar formula.
> >
> > Suggested-by: Ingo Molnar <mingo@...hat.com>
> > Signed-off-by: Vincent Guittot <vincent.guittot@...aro.org>
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> > Acked-by: Viresh Kumar <viresh.kumar@...aro.org>
> > Cc: Linus Torvalds <torvalds@...ux-foundation.org>
> > Cc: Peter Zijlstra <peterz@...radead.org>
> > Cc: Thomas Gleixner <tglx@...utronix.de>
> > Cc: rjw@...ysocki.net
> > Link: http://lkml.kernel.org/r/1532001606-6689-1-git-send-email-vincent.guittot@linaro.org
> > Signed-off-by: Ingo Molnar <mingo@...nel.org>
> > ---
> >  kernel/sched/core.c              |  2 +-
> >  kernel/sched/cpufreq_schedutil.c |  3 +--
> >  kernel/sched/fair.c              | 13 +++----------
> >  kernel/sched/sched.h             | 20 ++++++++++++++++++--
> >  4 files changed, 23 insertions(+), 15 deletions(-)
>
> This commit introduced a build warning in the SMP=n case, could we please fix that? (Probably
> the best to maintain variant would be to mark it as __maybe_unused.)

Dou sent a fix for this warning
https://lkml.org/lkml/2018/8/10/22
This one remove one HAVE_SCHED_AVG_IRQ which is at the opposite of
what yyou propose below

and Miguel also made a proposal:
https://lkml.org/lkml/2018/9/8/215
based on __maybe_unused

>
> Also, while at it, there's a number of other places that use this pattern:
>
> > -#if defined(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING)
> > +#ifdef HAVE_SCHED_AVG_IRQ
>
> Could we convert those to HAVE_SCHED_AVG_IRQ as well?

I'm not sure that we can convert all to HAVE_SCHED_AVG_IRQ

>
> dagon:~/tip> git grep 'defined(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING)' kernel/sched/
> kernel/sched/core.c:#if defined(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING)

we can't replace one because the variables can be used when
HAVE_SCHED_AVG_IRQ is undefined

> kernel/sched/fair.c:#if defined(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING)

This one can be replaced indeed

> kernel/sched/pelt.c:#if defined(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING)

This one can be replaced as well

> kernel/sched/pelt.h:#if defined(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING)

This one too

> kernel/sched/sched.h:#if defined(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING)
This one is used to declare HAVE_SCHED_AVG_IRQ

>
> Thanks,
>
>         Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ