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: <CAJZ5v0hw+797-mm3qA6PqQdA7hWyZKhkYobbvF+8MCvg1cHZvQ@mail.gmail.com>
Date: Thu, 4 Sep 2025 22:02:55 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Sohil Mehta <sohil.mehta@...el.com>
Cc: "Rafael J . Wysocki" <rafael@...nel.org>, Viresh Kumar <viresh.kumar@...aro.org>, linux-pm@...r.kernel.org, 
	x86@...nel.org, Tony Luck <tony.luck@...el.com>, Zhao Liu <zhao1.liu@...ux.intel.com>, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] cpufreq: ondemand: Update the efficient idle check for
 Intel extended Families

On Tue, Aug 26, 2025 at 8:38 PM Sohil Mehta <sohil.mehta@...el.com> wrote:
>
> IO time is considered busy by default for modern Intel processors. The
> current check covers recent Family 6 models but excludes the brand new
> Families 18 and 19.
>
> According to Arjan van de Ven, the model check was mainly due to a lack
> of testing on systems before INTEL_CORE2_MEROM. He suggests considering
> all Intel processors as having an efficient idle.
>
> Extend the IO busy classification to all Intel processors starting with
> Family 6, including Family 15 (Pentium 4s) and upcoming Families 18/19.
>
> Signed-off-by: Sohil Mehta <sohil.mehta@...el.com>
> ---
> v3:
>  - Posting this patch separately since the core family cleanup series
>    was merged without it.
>  - Improve commit message and code comments.
>
> v2: https://lore.kernel.org/lkml/20250211194407.2577252-7-sohil.mehta@intel.com/
> ---
>  drivers/cpufreq/cpufreq_ondemand.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
> index 0e65d37c9231..3decfc53fe68 100644
> --- a/drivers/cpufreq/cpufreq_ondemand.c
> +++ b/drivers/cpufreq/cpufreq_ondemand.c
> @@ -15,6 +15,10 @@
>  #include <linux/tick.h>
>  #include <linux/sched/cpufreq.h>

Since you are adding this #ifdef below, why don't you go a bit farther and do

> +#ifdef CONFIG_X86
> +#include <asm/cpu_device_id.h>

static bool should_io_be_busy(void)
{
       /* All Intel Family 6 and later processors have efficient idle. */
       return boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
boot_cpu_data.x86_vfm >= INTEL_PENTIUM_PRO;
}
#else
static inline bool should_io_be_busy(void)
{
        return false;
}
> +#endif
> +
>  #include "cpufreq_ondemand.h"
>
>  /* On-demand governor macros */
> @@ -41,12 +45,9 @@ static unsigned int default_powersave_bias;
>  static int should_io_be_busy(void)
>  {
>  #if defined(CONFIG_X86)
> -       /*
> -        * For Intel, Core 2 (model 15) and later have an efficient idle.
> -        */
> +       /* For Intel, Family 6 and later have an efficient idle. */
>         if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
> -                       boot_cpu_data.x86 == 6 &&
> -                       boot_cpu_data.x86_model >= 15)
> +           boot_cpu_data.x86_vfm >= INTEL_PENTIUM_PRO)
>                 return 1;
>  #endif
>         return 0;
> --

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ