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]
Message-ID: <CAJZ5v0jUPDM9_VYOz2V2NEjT0zke-vbP5Du8bj+PaaoXPq5WxA@mail.gmail.com>
Date:   Tue, 3 Jan 2023 18:08:45 +0100
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Kajetan Puchalski <kajetan.puchalski@....com>
Cc:     rafael@...nel.org, daniel.lezcano@...aro.org, lukasz.luba@....com,
        Dietmar.Eggemann@....com, dsmythies@...us.net,
        yu.chen.surf@...il.com, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH v5 0/2] cpuidle: teo: Introduce util-awareness

On Tue, Jan 3, 2023 at 3:22 PM Kajetan Puchalski
<kajetan.puchalski@....com> wrote:
>
> On Wed, Nov 30, 2022 at 03:32:02PM +0000, Kajetan Puchalski wrote:
>
> Hi Rafael,
>
> As it's been a while since the last email I wanted to bump this thread
> and ask what you think about the last changes.

Right, I'll send my comments on the last version of the patch separately.

> Additionally, I got some emails from the kernel test robot and noticed
> that sched_cpu_util is contingent on CONFIG_SMP so in the current form
> there's build errors on !SMP machines.
>
> The following change should fix the problem, do you think it's all right to add?
>
> @@ -207,10 +207,17 @@ static DEFINE_PER_CPU(struct teo_cpu, teo_cpus);
>   * @dev: Target CPU
>   * @cpu_data: Governor CPU data for the target CPU
>   */
> +#ifdef CONFIG_SMP
>  static void teo_get_util(struct cpuidle_device *dev, struct teo_cpu *cpu_data)
>  {
>         cpu_data->utilized = sched_cpu_util(dev->cpu) > cpu_data->util_threshold;
>  }
> +#else
> +static void teo_get_util(struct cpuidle_device *dev, struct teo_cpu *cpu_data)
> +{
> +       cpu_data->utilized = false;
> +}
> +#endif
>

IMV it would be better to use teo_cpu_is_utilized() that would be
called to update cpu_data->utilized this way

cpu_data->utilized = teo_cpu_is_utilized(dev->cpu, cpu_data->util_threshold);

and define it as an empty stab in the !SMP case.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ