Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo-sources-5.10.76-r1 doesn't use P-State
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2964
Location: Edge of marsh USA

PostPosted: Mon Nov 15, 2021 4:53 am    Post subject: Gentoo-sources-5.10.76-r1 doesn't use P-State Reply with quote

I've been running gentoo-sources stable in the 5.4 series for nearly a year and have been very happy with it. But, I felt challenged to move up and did as I wrote at: https://forums.gentoo.org/viewtopic-t-1145115.html#8677562, and on my second build and boot I solved the reported pcspkr error message.

Now that I'm running it, I expected to stay with 5.10 series for another year or more. Only issue is, it takes over an hour (70 minutes) to complete "make && make modules_install" compared to 28 minutes with 5.4.156. During the builds after booting into 5.10.76-r1, CPU frequency and load barely budged above baseline.

I see the problem, but I don't know what to do about it. When booted to 5.10.76-r1, P-State is not being used. I'd like to continue to use P-State but don't know how to do that.
Code:
# cpupower frequency-info
analyzing CPU 0:
  driver: intel_cpufreq
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 20.0 us
  hardware limits: 1.60 GHz - 3.80 GHz
  available cpufreq governors: userspace powersave performance schedutil
  current policy: frequency should be within 1.60 GHz and 3.80 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 1.60 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    3500 MHz max turbo 4 active cores
    3600 MHz max turbo 3 active cores
    3700 MHz max turbo 2 active cores
    3800 MHz max turbo 1 active cores


Here were the settings in .config for 5.4.156:
Code:
# grep -i freq .config
CONFIG_ACPI_CPU_FREQ_PSS=y
# CPU Frequency scaling
CONFIG_CPU_FREQ=y
# CONFIG_CPU_FREQ_STAT is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
# CONFIG_CPU_FREQ_GOV_SCHEDUTIL is not set
# CPU frequency scaling drivers
# CONFIG_X86_PCC_CPUFREQ is not set
# CONFIG_X86_ACPI_CPUFREQ is not set
# end of CPU Frequency scaling
# CONFIG_PM_DEVFREQ is not set

# grep -i pstate .config
CONFIG_X86_INTEL_PSTATE=y


And for 5.10.76-r1
Code:
# grep -i freq /usr/src/linux/.config
CONFIG_ACPI_CPU_FREQ_PSS=y
# CPU Frequency scaling
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
# CONFIG_CPU_FREQ_STAT is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
# CPU frequency scaling drivers
# CONFIG_X86_PCC_CPUFREQ is not set
# CONFIG_X86_ACPI_CPUFREQ is not set
# end of CPU Frequency scaling
# CONFIG_INTEL_UNCORE_FREQ_CONTROL is not set
# CONFIG_PM_DEVFREQ is not set

bethel # grep -i pstate /usr/src/linux/.config
CONFIG_X86_INTEL_PSTATE=y


ADDED: Maybe this looks at it from a different angle. I put the output of grep .config for 5.4.156 into file 54156 and the output for grep .config in the file 10761 and then ran diff:
Code:
$ diff 4156 10761
0a1
> CONFIG_CPU_FREQ_GOV_ATTR_SET=y
4,5d4
< # CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
< # CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
12c11
< # CONFIG_CPU_FREQ_GOV_SCHEDUTIL is not set
---
> CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
19d17
< # CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR is not set
24d21
< # CONFIG_THERMAL_GOV_POWER_ALLOCATOR is not set

What I mainly notice is that "CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y" is force Y in 5.10.76-r1.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
spica
Apprentice
Apprentice


Joined: 04 Jun 2021
Posts: 287

PostPosted: Mon Nov 15, 2021 8:06 am    Post subject: Re: Gentoo-sources-5.10.76-r1 doesn't use P-State Reply with quote

figueroa wrote:
What I mainly notice is that "CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y" is force Y in 5.10.76-r1.
I have this option enabled and scaling driver is pstate at the same time:
Code:
# for i in scaling_driver scaling_available_governors scaling_governor; do echo -n "$i: "; cat /sys/devices/system/cpu/cpu0/cpufreq/$i; done
scaling_driver: intel_pstate
scaling_available_governors: performance powersave
scaling_governor: powersave

# zgrep -iE '^[^#]+(freq|pstate)' /proc/config.gz | sort
CONFIG_ACPI_CPU_FREQ_PSS=y
CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
CONFIG_CPU_FREQ_GOV_COMMON=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ=y
CONFIG_X86_ACPI_CPUFREQ=y
CONFIG_X86_INTEL_PSTATE=y
CONFIG_X86_PCC_CPUFREQ=m
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4147
Location: Bavaria

PostPosted: Mon Nov 15, 2021 12:53 pm    Post subject: Reply with quote

P-State is using only "powersave" and "performance" (I recommend "performance" for a desktop and "powersave" for notebooks").
P-State is recommended by Intel for all newer processors. See more here in this thread: https://forums.gentoo.org/viewtopic-t-1144881-highlight-pstate.html
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2964
Location: Edge of marsh USA

PostPosted: Mon Nov 15, 2021 5:26 pm    Post subject: Reply with quote

Thank you both for replying.

I followed the kernel config advice offered by spica, but I don't get P-State, rather driver: intel_cpufreq, and schedutil as the default governor. It's not what I was looking for but it does seem to be responsive, well modulated, and fast when necessary.
Code:
# cpupower frequency-info
analyzing CPU 0:
  driver: intel_cpufreq
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 20.0 us
  hardware limits: 1.60 GHz - 3.80 GHz
  available cpufreq governors: ondemand userspace powersave performance schedutil
  current policy: frequency should be within 1.60 GHz and 3.80 GHz.
                  The governor "schedutil" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 1.60 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    3500 MHz max turbo 4 active cores
    3600 MHz max turbo 3 active cores
    3700 MHz max turbo 2 active cores
    3800 MHz max turbo 1 active cores

Code:
# ls /sys/devices/system/cpu/cpu0/cpufreq/*
/sys/devices/system/cpu/cpu0/cpufreq/affected_cpus
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency
/sys/devices/system/cpu/cpu0/cpufreq/related_cpus
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed

Code:
#  for i in scaling_driver scaling_available_governors scaling_governor; do echo -n "$i: "; cat /sys/devices/system/cpu/cpu0/cpufreq/$i; done
scaling_driver: intel_cpufreq
scaling_available_governors: ondemand userspace powersave performance schedutil
scaling_governor: schedutil

As a test, I did emerge -1 imagemagick, and it built in 2'39" (expected range) today, versus 3'06" yesterday with 5.4.156 (slower than normal).

My relevant 5.10.76-r1 kernel config is as follows, and I think matches what spica put up:
Code:
# grep -iE '^[^#]+(freq|pstate)' /usr/src/linux/.config
CONFIG_ACPI_CPU_FREQ_PSS=y
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
CONFIG_CPU_FREQ_GOV_COMMON=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
CONFIG_X86_INTEL_PSTATE=y
CONFIG_X86_PCC_CPUFREQ=m
CONFIG_X86_ACPI_CPUFREQ=y

Should I WANT P-State driver? According to what I've read I think I should want P-State. How would I get it?
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4147
Location: Bavaria

PostPosted: Mon Nov 15, 2021 8:42 pm    Post subject: Reply with quote

figueroa wrote:
Should I WANT P-State driver? According to what I've read I think I should want P-State. How would I get it?


figueroa,

may I ask you which CPU you have ? I ask, because AFAIK (=I can be wrong here) IF you enable P-State (you did: "CONFIG_X86_INTEL_PSTATE=y") THEN the kernel will use it at first (even if you set some ACPI with yes), BUT ONLY for some newer CPUs (Sandy Bridge and later generations).

So, if you have an old Core2Duo (I dont hink so) then you can not use it. For a newer CPU I am surprised that P-State is not used by your kernel ...
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2964
Location: Edge of marsh USA

PostPosted: Mon Nov 15, 2021 9:17 pm    Post subject: Reply with quote

Thank you for replying pietinger. As noted in my signature, my CPU is:
Code:
i7-2600 @ 3.40GHz

Under 5.4 kernel series it was actively using P-State driver. After updating to 5.10.76-r1, it wasn't using P-State and wasn't managing CPU frequency at all.

I followed spica's configuration to get to where I'm at. It seems like it's working well, but not using P-State driver. The changes in kernel configuration are noted in this thread above.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4147
Location: Bavaria

PostPosted: Mon Nov 15, 2021 10:27 pm    Post subject: Reply with quote

figueroa wrote:
As noted in my signature, my CPU is:
Code:
i7-2600 @ 3.40GHz

Under 5.4 kernel series it was actively using P-State driver. After updating to 5.10.76-r1, it wasn't using P-State and wasn't managing CPU frequency at all. It seems like it's working well, but not using P-State driver. The changes in kernel configuration are noted in this thread above.

Thanks for your answer and sorry for I didnt read your signature. My only (logical) explanation at the moment is: There must be some changes in the kernel with P-state (possibly only first timer processors like sandy bridge itself); it would be very interesting what happens when using the next LTS kernel series (5.15). I am sorry I dont know more for your cpu and cant help.
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2964
Location: Edge of marsh USA

PostPosted: Tue Nov 16, 2021 3:32 am    Post subject: Reply with quote

pietinger -- Thank you for engaging. I'm hoping someone will pass through and provide a good clue.

ADDING: I found: https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.7-Schedutil-P-State that reads, in part:
Quote:
On top of all the other changes in Linux 5.7 so far, a secondary set of power management updates were sent in today for this next version of the kernel and includes now using the Schedutil governor by default for Intel P-State and Arm big.LITTLE systems.


For my "just a user" background, it's clear as mud, but maybe what I've got now is as it should be. I'll keep looking, but this combination seems very responsive as I can see CPU frequency bouncing around in conky responding to every little demand, and during emerges I get some turbo range frequencies too.

ADDING2: Also: https://www.phoronix.com/scan.php?page=article&item=linux50-pstate-cpufreq&num=1
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4147
Location: Bavaria

PostPosted: Tue Nov 16, 2021 6:25 am    Post subject: Reply with quote

figueroa - Thanks a lot for the links. I believe the second one I have seen before (long, long ago; but I cant remember exactly). The first link is very interesting and I didnt knew that.

I have only this with my 5.10.78 kernel:
Code:
/usr/src/linux $ zgrep -iE '^[^#]+(freq|pstate)' .config | sort
CONFIG_ACPI_CPU_FREQ_PSS=y
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ=y
CONFIG_X86_INTEL_PSTATE=y


This leads to:
Code:
$ LC_ALL=C cpupower frequency-info
analyzing CPU 0:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 800 MHz - 4.00 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 800 MHz and 4.00 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 3.95 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
Back to top
View user's profile Send private message
smartding
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jan 2021
Posts: 129

PostPosted: Tue Nov 16, 2021 6:32 am    Post subject: Reply with quote

I have a Intel i5-4460S and running 5.10.76-r1 kernel with CONFIG_X86_INTEL_PSTATE=y.

"cat /sys/devices/system/cpu/intel_pstate/status" shows p-state is in "passive" mode

"cat /sys/devices/system/cpu/cpufreq/policy0/scaling_driver" shows the driver is intel_cpufreq.

So I guess p-state isn't working.

I tried some new kernels in arch Linux (arch linux is my platform to try new stuff, because I don't have to compile anything), 5.14.16 and 5.15.2, same issue.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4147
Location: Bavaria

PostPosted: Tue Nov 16, 2021 6:36 am    Post subject: Reply with quote

What happens if you disable: "CONFIG_X86_ACPI_CPUFREQ=y" ?
Back to top
View user's profile Send private message
smartding
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jan 2021
Posts: 129

PostPosted: Tue Nov 16, 2021 7:02 am    Post subject: Reply with quote

pietinger wrote:
What happens if you disable: "CONFIG_X86_ACPI_CPUFREQ=y" ?


I disabled CONFIG_X86_ACPI_CPUFREQ, but nothing changed.

Running "zgrep -iE '^[^#]+(freq|pstate)' .config | sort" now shows:

Code:

CONFIG_ACPI_CPU_FREQ_PSS=y
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
CONFIG_CPU_FREQ_GOV_COMMON=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ=y
CONFIG_X86_INTEL_PSTATE=y
Back to top
View user's profile Send private message
spica
Apprentice
Apprentice


Joined: 04 Jun 2021
Posts: 287

PostPosted: Tue Nov 16, 2021 8:05 am    Post subject: Reply with quote

figueroa,

What's in dmesg?

This is for reference from my laptop:
Code:
# dmesg | grep pstate
[    0.697590] intel_pstate: Intel P-state driver initializing
[    0.698461] intel_pstate: Disabling energy efficiency optimization
[    0.698462] intel_pstate: HWP enabled


The first line is printed here https://github.com/torvalds/linux/blob/v5.10/drivers/cpufreq/intel_pstate.c#L3072 (not sure if this is the right commit in git, who knows better, please correct me). If we have no other options then we need to dig the source...
Back to top
View user's profile Send private message
smartding
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jan 2021
Posts: 129

PostPosted: Tue Nov 16, 2021 8:09 am    Post subject: Reply with quote

spica wrote:
What's in dmesg?

This is for reference:
Code:
# dmesg | grep pstate
[    0.697590] intel_pstate: Intel P-state driver initializing
[    0.698461] intel_pstate: Disabling energy efficiency optimization
[    0.698462] intel_pstate: HWP enabled



dmesg shows:

Code:

[    0.282861] intel_pstate: Intel P-state driver initializing


then nothing.
Back to top
View user's profile Send private message
spica
Apprentice
Apprentice


Joined: 04 Jun 2021
Posts: 287

PostPosted: Tue Nov 16, 2021 8:29 am    Post subject: Reply with quote

smartding,

For your case, you can try experimenting with intel_pstate=active or intel_pstate=force in kernel command string.
This documentation should help you.
Available param values in source code (not sure if this is the proper commit in git, may differ from files in /usr/src/linux)
Back to top
View user's profile Send private message
smartding
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jan 2021
Posts: 129

PostPosted: Tue Nov 16, 2021 9:06 am    Post subject: Reply with quote

spica wrote:
smartding,

For your case, you can try experimenting with intel_pstate=active or intel_pstate=force in kernel command string.
This documentation should help you.
Available param values in source code (not sure if this is the proper commit in git, may differ from files in /usr/src/linux)


Setting intel_pstate=active does make p-state active for me, although intel_pstate=force doesn't.

I found this reddit article, which says Linux kernel 5.8 defaults to passive mode for intel_pstate driver for cpu before skylake, maybe this is still the case for newer kernels.

It explains why I have to pass the intel_pstate=active kernel command string for my i5-4460S CPU to activate p-state, but not for my new tiger lake CPU.

https://www.reddit.com/r/linux/comments/ihdozd/linux_kernel_58_defaults_to_passive_mode_for/
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4147
Location: Bavaria

PostPosted: Tue Nov 16, 2021 10:51 am    Post subject: Reply with quote

smartding wrote:
https://www.reddit.com/r/linux/comments/ihdozd/linux_kernel_58_defaults_to_passive_mode_for/

Also a great link, thank you.
Its funny, I have an Intel i7-6700 ... Skylake ... able to do HWP:
Code:
# dmesg | grep pstate
[    2.228213] intel_pstate: Intel P-state driver initializing
[    2.228807] intel_pstate: HWP enabled
Back to top
View user's profile Send private message
smartding
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jan 2021
Posts: 129

PostPosted: Tue Nov 16, 2021 11:00 am    Post subject: Reply with quote

pietinger wrote:

Its funny, I have an Intel i7-6700 ... Skylake ... able to do HWP:
Code:
# dmesg | grep pstate
[    2.228213] intel_pstate: Intel P-state driver initializing
[    2.228807] intel_pstate: HWP enabled


The reddit article means there's HWP for Skylake and above.
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2964
Location: Edge of marsh USA

PostPosted: Tue Nov 16, 2021 9:22 pm    Post subject: Reply with quote

I too have only:
Code:
$ dmesg | grep -i pstat
[Mon Nov 15 11:56:34 2021] intel_pstate: Intel P-state driver initializing


ADDED: From redit link: https://www.reddit.com/r/linux/comments/ihdozd/linux_kernel_58_defaults_to_passive_mode_for/
Code:
# echo active > /sys/devices/system/cpu/intel_pstate/status

and that just works:
Code:
# cpupower frequency-info
analyzing CPU 0:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 1.60 GHz - 3.80 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 1.60 GHz and 3.80 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 1.60 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    3500 MHz max turbo 4 active cores
    3600 MHz max turbo 3 active cores
    3700 MHz max turbo 2 active cores
    3800 MHz max turbo 1 active cores

Now to figure out if there is a kernel configuration setting to just make that work.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
spica
Apprentice
Apprentice


Joined: 04 Jun 2021
Posts: 287

PostPosted: Tue Nov 16, 2021 9:47 pm    Post subject: Reply with quote

figueroa,

I found this commit and this - these changes appear in v5.8.
According to code, by default, if CPU has no HWP, then the default driver is cpufreq.

It seems, there's no kernel configuration parameter. kernel cmd is the only possible way to force it, see /usr/src/linux/drivers/cpufreq/intel_pstate.c
Code:
static int __init intel_pstate_setup(char *str)
{
   if (!str)
      return -EINVAL;

   if (!strcmp(str, "disable"))
      no_load = 1;
   else if (!strcmp(str, "active"))
      default_driver = &intel_pstate;
   else if (!strcmp(str, "passive"))
      default_driver = &intel_cpufreq;

   if (!strcmp(str, "no_hwp"))
      no_hwp = 1;

   if (!strcmp(str, "force"))
      force_load = 1;
   if (!strcmp(str, "hwp_only"))
      hwp_only = 1;
   if (!strcmp(str, "per_cpu_perf_limits"))
      per_cpu_limits = true;

#ifdef CONFIG_ACPI
   if (!strcmp(str, "support_acpi_ppc"))
      acpi_ppc = true;
#endif

   return 0;
}
early_param("intel_pstate", intel_pstate_setup);


Last edited by spica on Tue Nov 16, 2021 10:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2964
Location: Edge of marsh USA

PostPosted: Tue Nov 16, 2021 10:00 pm    Post subject: Reply with quote

Seems to be up-in-the-air which state is better and not everybody agrees. It's really hard to compare going from 5.4 series to 5.10 while changing cpu frequency scaling at the same time. I don't have an opinion, yet if ever. But, I'm glad I started this thread.

ADDED: The Arch wiki has a good section explaining the selection of CPU frequency driver based on Intel CPU generation and kernel version.
https://wiki.archlinux.org/title/CPU_frequency_scaling#CPU_frequency_driver

According to this, p-state passive is selected purposefully which results in use of intel_cpufreq driver for 5th generation and lower from kernel 5.7 and up. After a couple of days, I can report that cpu frequencies appear to be well modulated, change quickly, over the full range of speed including turbo. I still can't comment objectively on performance. Desktop user apparent performance remains excellent.
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum