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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0h25d9CCOBzU30mDggTSwbJ7UVnUbRD773UXhhAanqCdg@mail.gmail.com>
Date:   Fri, 9 Feb 2018 12:14:45 +0100
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Claudio Scordino <claudio@...dence.eu.com>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        "Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
        Patrick Bellasi <patrick.bellasi@....com>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Morten Rasmussen <morten.rasmussen@....com>,
        Juri Lelli <juri.lelli@...hat.com>,
        Viresh Kumar <viresh.kumar@...aro.org>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Todd Kjos <tkjos@...roid.com>,
        Joel Fernandes <joelaf@...gle.com>,
        Linux PM <linux-pm@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] cpufreq: schedutil: rate limits for SCHED_DEADLINE

On Thu, Feb 8, 2018 at 6:01 PM, Claudio Scordino
<claudio@...dence.eu.com> wrote:
> When the SCHED_DEADLINE scheduling class increases the CPU utilization,
> we should not wait for the rate limit, otherwise we may miss some deadline.
>
> Tests using rt-app on Exynos5422 have shown reductions of about 10% of deadline
> misses for tasks with low RT periods.
>
> The patch applies on top of the one recently proposed by Peter to drop the
> SCHED_CPUFREQ_* flags.
>
> Signed-off-by: Claudio Scordino <claudio@...dence.eu.com>
> CC: Rafael J . Wysocki <rafael.j.wysocki@...el.com>
> CC: Patrick Bellasi <patrick.bellasi@....com>
> CC: Dietmar Eggemann <dietmar.eggemann@....com>
> CC: Morten Rasmussen <morten.rasmussen@....com>
> CC: Juri Lelli <juri.lelli@...hat.com>
> CC: Viresh Kumar <viresh.kumar@...aro.org>
> CC: Vincent Guittot <vincent.guittot@...aro.org>
> CC: Todd Kjos <tkjos@...roid.com>
> CC: Joel Fernandes <joelaf@...gle.com>
> CC: linux-pm@...r.kernel.org
> CC: linux-kernel@...r.kernel.org
> ---
>  kernel/sched/cpufreq_schedutil.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
> index b0bd77d..d8dcba2 100644
> --- a/kernel/sched/cpufreq_schedutil.c
> +++ b/kernel/sched/cpufreq_schedutil.c
> @@ -74,7 +74,10 @@ static DEFINE_PER_CPU(struct sugov_cpu, sugov_cpu);
>
>  /************************ Governor internals ***********************/
>
> -static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time)
> +static bool sugov_should_update_freq(struct sugov_policy *sg_policy,
> +                                    u64 time,
> +                                    struct sugov_cpu *sg_cpu_old,
> +                                    struct sugov_cpu *sg_cpu_new)

This looks somewhat excessive for using just one field from each of these.

>  {
>         s64 delta_ns;
>
> @@ -111,6 +114,10 @@ static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time)
>                 return true;
>         }
>
> +       /* Ignore rate limit when DL increased utilization. */
> +       if (sg_cpu_new->util_dl > sg_cpu_old->util_dl)
> +               return true;
> +
>         delta_ns = time - sg_policy->last_freq_update_time;
>         return delta_ns >= sg_policy->freq_update_delay_ns;
>  }
> @@ -271,6 +278,7 @@ static void sugov_update_single(struct update_util_data *hook, u64 time,
>                                 unsigned int flags)
>  {
>         struct sugov_cpu *sg_cpu = container_of(hook, struct sugov_cpu, update_util);
> +       struct sugov_cpu sg_cpu_old = *sg_cpu;

And here you copy the entire struct to pass a pointer to the copy to a
helper function so that it can access one field.

That doesn't look particularly straightforward to me, let alone the overhead.

I guess you may do the check before calling sugov_should_update_freq()
and set sg_policy->need_freq_update if its true, as you know upfront
that the previous sg_policy->next_freq value isn't going to be used
anyway in that case.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ