View previous topic :: View next topic |
Author |
Message |
Spargeltarzan Guru

Joined: 23 Jul 2017 Posts: 312
|
Posted: Tue Sep 04, 2018 12:35 pm Post subject: Cpu Frequency Scaling - Intel P State |
|
|
Hi,
I migrated my notebook to openrc and my cpu frequency scaling isn't working any more.
I have compiled the kernel with Intel P State for the modern cpus and selected the governor "performance", because this is the recommended setting for modern cpu and provides even better scaling than "ondemand". Formerly I was also on this governor.
I have installed laptop-mode-tools and activated the cpufreq.conf.
My frequency is constantly ~3000 Mhz - what could I do more?
Thanks in advance! _________________ ___________________
Regards
Spargeltarzan
Notebook: Lenovo YOGA 900-13ISK: Gentoo stable amd64, GNOME systemd, KVM/QEMU
Desktop-PC: Intel Core i7-4770K, 8GB Ram, AMD Radeon R9 280X, ZFS Storage, GNOME openrc, Dantrell, Xen |
|
Back to top |
|
 |
Jaglover Watchman


Joined: 29 May 2005 Posts: 7798 Location: Saint Amant, Acadiana
|
|
Back to top |
|
 |
P.Kosunen Guru

Joined: 21 Nov 2005 Posts: 309 Location: Finland
|
Posted: Tue Sep 04, 2018 1:11 pm Post subject: |
|
|
Some kernels CPU Frequency scaling drivers need to be also enabled. |
|
Back to top |
|
 |
fedeliallalinea Moderator


Joined: 08 Mar 2003 Posts: 25412 Location: here
|
Posted: Tue Sep 04, 2018 1:14 pm Post subject: |
|
|
P.Kosunen wrote: | Some kernels CPU Frequency scaling drivers need to be also enabled. |
If I'm not mistaken p-state ignore this module is the processor that decides what to do _________________ Questions are guaranteed in life; Answers aren't. |
|
Back to top |
|
 |
bunder Bodhisattva

Joined: 10 Apr 2004 Posts: 5923
|
Posted: Tue Sep 04, 2018 1:40 pm Post subject: |
|
|
I could be wrong about this, but I think most intels only support 'performance' and 'powersave', if you set it to powersave it should go down to around 800mhz. _________________
Neddyseagoon wrote: | The problem with leaving is that you can only do it once and it reduces your influence. |
banned from #gentoo since sept 2017 |
|
Back to top |
|
 |
P.Kosunen Guru

Joined: 21 Nov 2005 Posts: 309 Location: Finland
|
Posted: Tue Sep 04, 2018 1:53 pm Post subject: |
|
|
Code: | # cat /sys/devices/system/cpu/cpufreq/policy1/scaling_governor
powersave
# cat /sys/devices/system/cpu/cpufreq/policy1/scaling_available_governors
performance powersave |
Oh yes, remember having same problem with NUCs. |
|
Back to top |
|
 |
Spargeltarzan Guru

Joined: 23 Jul 2017 Posts: 312
|
Posted: Tue Sep 04, 2018 2:04 pm Post subject: |
|
|
Jaglover wrote: |
You better add powersave, it will be used by pstates driver to scale down the frequency.
|
I was thinking opposite, that the machine boots in "performance" and pstate scales done when the CPU is not needed. My thinking was wrong, I compiled the kernel now with default "powersave" and it scales down to ~800 Mhz. When launching firefox for example, it increases to 3000 Mhz again.
Would you support me to optimise my power consumption a bit more, I still feel like it is less battery than formerly with systemd setup (but I guess the init system has not much todo with it).
fedeliallalinea wrote: | P.Kosunen wrote: | Some kernels CPU Frequency scaling drivers need to be also enabled. |
If I'm not mistaken p-state ignore this module is the processor that decides what to do |
I have attached my kernel .config for CPU scaling and ACPI. For drivers I have X86_INTEL_PSTATE=y and X86_PCC_CPUFREQ=m and the rest no. Am I right here?
Maybe I will need additionally those two for better idle?
# CONFIG_INTEL_IDLE is not set
# CONFIG_CPU_IDLE_GOV_LADDER is not set
Code: |
#
# CPU Frequency scaling
#
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_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=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
#
# CPU frequency scaling drivers
#
CONFIG_X86_INTEL_PSTATE=y
CONFIG_X86_PCC_CPUFREQ=m
# CONFIG_X86_ACPI_CPUFREQ is not set
# CONFIG_X86_SPEEDSTEP_CENTRINO is not set
# CONFIG_X86_P4_CLOCKMOD is not set
#
# shared options
#
#
# CPU Idle
#
CONFIG_CPU_IDLE=y
# CONFIG_CPU_IDLE_GOV_LADDER is not set
CONFIG_CPU_IDLE_GOV_MENU=y
# CONFIG_INTEL_IDLE is not set
|
Additionally, I have attached my current ACPI settings:
Code: |
#
# Power management and ACPI options
#
CONFIG_ARCH_HIBERNATION_HEADER=y
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
# CONFIG_SUSPEND_SKIP_SYNC is not set
CONFIG_HIBERNATE_CALLBACKS=y
CONFIG_HIBERNATION=y
CONFIG_PM_STD_PARTITION=""
CONFIG_PM_SLEEP=y
CONFIG_PM_SLEEP_SMP=y
# CONFIG_PM_AUTOSLEEP is not set
# CONFIG_PM_WAKELOCKS is not set
CONFIG_PM=y
CONFIG_PM_DEBUG=y
# CONFIG_PM_ADVANCED_DEBUG is not set
# CONFIG_PM_TEST_SUSPEND is not set
CONFIG_PM_SLEEP_DEBUG=y
CONFIG_PM_TRACE=y
CONFIG_PM_TRACE_RTC=y
CONFIG_PM_CLK=y
# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
CONFIG_ACPI=y
CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y
CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y
CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y
# CONFIG_ACPI_DEBUGGER is not set
CONFIG_ACPI_SPCR_TABLE=y
CONFIG_ACPI_LPIT=y
CONFIG_ACPI_SLEEP=y
# CONFIG_ACPI_PROCFS_POWER is not set
CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y
# CONFIG_ACPI_EC_DEBUGFS is not set
CONFIG_ACPI_AC=y
CONFIG_ACPI_BATTERY=y
CONFIG_ACPI_BUTTON=y
CONFIG_ACPI_VIDEO=y
CONFIG_ACPI_FAN=y
# CONFIG_ACPI_TAD is not set
CONFIG_ACPI_DOCK=y
CONFIG_ACPI_CPU_FREQ_PSS=y
CONFIG_ACPI_PROCESSOR_CSTATE=y
CONFIG_ACPI_PROCESSOR_IDLE=y
CONFIG_ACPI_CPPC_LIB=y
CONFIG_ACPI_PROCESSOR=y
CONFIG_ACPI_HOTPLUG_CPU=y
CONFIG_ACPI_PROCESSOR_AGGREGATOR=m
CONFIG_ACPI_THERMAL=y
CONFIG_ACPI_NUMA=y
CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y
CONFIG_ACPI_TABLE_UPGRADE=y
# CONFIG_ACPI_DEBUG is not set
# CONFIG_ACPI_PCI_SLOT is not set
CONFIG_ACPI_CONTAINER=y
CONFIG_ACPI_HOTPLUG_IOAPIC=y
# CONFIG_ACPI_SBS is not set
# CONFIG_ACPI_HED is not set
# CONFIG_ACPI_CUSTOM_METHOD is not set
# CONFIG_ACPI_BGRT is not set
# CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set
# CONFIG_ACPI_NFIT is not set
CONFIG_HAVE_ACPI_APEI=y
CONFIG_HAVE_ACPI_APEI_NMI=y
# CONFIG_ACPI_APEI is not set
# CONFIG_DPTF_POWER is not set
# CONFIG_ACPI_EXTLOG is not set
# CONFIG_PMIC_OPREGION is not set
# CONFIG_ACPI_CONFIGFS is not set
CONFIG_X86_PM_TIMER=y
# CONFIG_SFI is not set
|
Powertop reports a power consumption of ~ 9W. I have 850 awaking calls/second. Are those good values? _________________ ___________________
Regards
Spargeltarzan
Notebook: Lenovo YOGA 900-13ISK: Gentoo stable amd64, GNOME systemd, KVM/QEMU
Desktop-PC: Intel Core i7-4770K, 8GB Ram, AMD Radeon R9 280X, ZFS Storage, GNOME openrc, Dantrell, Xen |
|
Back to top |
|
 |
albright Advocate


Joined: 16 Nov 2003 Posts: 2588 Location: Near Toronto
|
Posted: Tue Sep 04, 2018 2:14 pm Post subject: |
|
|
Quote: | Powertop reports a power consumption of ~ 9W. I have 850 awaking calls/second. Are those good values? |
I have a thinkpad x1 carbon with i7-6600U and powertop reports idle
power use about 5 watts.
I use TLP for power management and it seems to work well. _________________ .... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme) |
|
Back to top |
|
 |
Spargeltarzan Guru

Joined: 23 Jul 2017 Posts: 312
|
Posted: Tue Sep 04, 2018 2:28 pm Post subject: |
|
|
albright wrote: |
I have a thinkpad x1 carbon with i7-6600U and powertop reports idle
power use about 5 watts.
I use TLP for power management and it seems to work well. |
Do you use an overlay for it? Could you send me some details? I have found an bug for it, but it is not commented in 2018.
Do you think this suits also on a Lenovo Yoga 900? Looks like it is for Thinkpads _________________ ___________________
Regards
Spargeltarzan
Notebook: Lenovo YOGA 900-13ISK: Gentoo stable amd64, GNOME systemd, KVM/QEMU
Desktop-PC: Intel Core i7-4770K, 8GB Ram, AMD Radeon R9 280X, ZFS Storage, GNOME openrc, Dantrell, Xen |
|
Back to top |
|
 |
albright Advocate


Joined: 16 Nov 2003 Posts: 2588 Location: Near Toronto
|
Posted: Tue Sep 04, 2018 4:26 pm Post subject: |
|
|
yes, I use the tlp overlay
the config file is pretty clear (tlp.conf). There might be
some thinkpad specific stuff but I think it's mostly
pretty widely applicable. Worth a try.
You might also try undervolting See: https://github.com/georgewhewell/undervolt
though it does not do much on the U-chips ... _________________ .... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme) |
|
Back to top |
|
 |
Logicien Veteran


Joined: 16 Sep 2005 Posts: 1419 Location: Montréal
|
Posted: Tue Sep 04, 2018 5:50 pm Post subject: |
|
|
With generic kernels I pass the kernel parameter intel_pstate=disable and use acpi-cpufreq as the support for frequency scaling, it work well. _________________ Paul |
|
Back to top |
|
 |
Spargeltarzan Guru

Joined: 23 Jul 2017 Posts: 312
|
Posted: Tue Sep 04, 2018 9:35 pm Post subject: |
|
|
@albright: I installed tlp from the overlay and activated it.
In idle with wifi on I have around 7-8.5 W power consumption. Without wifi I get 6.5W. Is your 5 W with all devices deactivated? Did you further tune something?
@Logicien: Thanks for the hint, I will compare results with acpi-cpufreq. _________________ ___________________
Regards
Spargeltarzan
Notebook: Lenovo YOGA 900-13ISK: Gentoo stable amd64, GNOME systemd, KVM/QEMU
Desktop-PC: Intel Core i7-4770K, 8GB Ram, AMD Radeon R9 280X, ZFS Storage, GNOME openrc, Dantrell, Xen |
|
Back to top |
|
 |
albright Advocate


Joined: 16 Nov 2003 Posts: 2588 Location: Near Toronto
|
Posted: Tue Sep 04, 2018 11:32 pm Post subject: |
|
|
Quote: | In idle with wifi on I have around 7-8.5 W power consumption. Without wifi I get 6.5W. Is your 5 W with all devices deactivated? Did you further tune something? |
bluetooth is deactivated, but everything else is running,
my screen is about 1/3 brightness (good enough in my
dim room).
I have all the power save features ON BAT in tlp.conf set ON
(I suspect you do too). _________________ .... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme) |
|
Back to top |
|
 |
Spargeltarzan Guru

Joined: 23 Jul 2017 Posts: 312
|
Posted: Wed Sep 05, 2018 11:00 am Post subject: |
|
|
Hmm, whatever I try I can't reduce the power consumption further. I have even set in powertop all measurements to "good" additionally to tlp with the power saving features on. My 8.5 W are with wifi on and on extremely little display brightness, one step less would lead to a black screen. Only at night possible to work with it.
It somehow must be possible to reduce it a bit more, in my former setup with systemd I managed to run 8-9hours with wifi on, one day with my notebook with battery only wasn't a problem for me. Now it says ~5-6 hours.
I am on the latest 4.18.5 kernel which offers better energy management since 4.17.
I can't imagine systemd helped me for less power consumption, or at least I don't want it to be true
What do you think? _________________ ___________________
Regards
Spargeltarzan
Notebook: Lenovo YOGA 900-13ISK: Gentoo stable amd64, GNOME systemd, KVM/QEMU
Desktop-PC: Intel Core i7-4770K, 8GB Ram, AMD Radeon R9 280X, ZFS Storage, GNOME openrc, Dantrell, Xen |
|
Back to top |
|
 |
albright Advocate


Joined: 16 Nov 2003 Posts: 2588 Location: Near Toronto
|
Posted: Wed Sep 05, 2018 11:34 am Post subject: |
|
|
you have verified that your cpu is scaling properly and spends
a lot of time in C10?
my cpu goes down to 600mhz when idle and spends 90%+
in C10. _________________ .... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme) |
|
Back to top |
|
 |
Spargeltarzan Guru

Joined: 23 Jul 2017 Posts: 312
|
Posted: Wed Sep 05, 2018 12:12 pm Post subject: |
|
|
My cpu goes down to 800 Mhz, but scales up extremely easy. For example if I have "top" in one terminal without touching my notebook, the cpu scales up every 5 seconds. When I click something with the mouse, like just open the menu "file" or "edit", the cpu scales up already to ~2500 Mhz.
With only 2 terminals open, powertop and top, the cpu is about 50-80 % in C10, 25% in C8 and the rest spreads in C6 and C0 (active) mostly. When I close everything beside "powertop", my cpu is after one minute 87% in C10. Until I touch something minor...
My cpu climbes very easy to 25%, or 30% usage without touching my computer, only with those two terminals open. gnome-shell and tracker-extract are like every 10 seconds in "top" on the top two places. I have deactivated "the search" in the gnome-settings.
On my Desktop CPU with the same setup the CPU doesn't climb up that easily, although "the search" is activated. While typing this post in firefox it is mostly at 2-3% usage, sometimes goes up to 10%.
hmmmmmmm _________________ ___________________
Regards
Spargeltarzan
Notebook: Lenovo YOGA 900-13ISK: Gentoo stable amd64, GNOME systemd, KVM/QEMU
Desktop-PC: Intel Core i7-4770K, 8GB Ram, AMD Radeon R9 280X, ZFS Storage, GNOME openrc, Dantrell, Xen |
|
Back to top |
|
 |
P.Kosunen Guru

Joined: 21 Nov 2005 Posts: 309 Location: Finland
|
Posted: Wed Sep 05, 2018 4:10 pm Post subject: |
|
|
Spargeltarzan wrote: | Maybe I will need additionally those two for better idle?
# CONFIG_INTEL_IDLE is not set |
I believe this should be enabled, don't know about ladders.
https://github.com/torvalds/linux/blob/master/drivers/idle/intel_idle.c
Quote: | /*
* intel_idle is a cpuidle driver that loads on specific Intel processors
* in lieu of the legacy ACPI processor_idle driver. The intent is to
* make Linux more efficient on these processors, as intel_idle knows
* more than ACPI, as well as make Linux more immune to ACPI BIOS bugs.
*/ |
|
|
Back to top |
|
 |
Spargeltarzan Guru

Joined: 23 Jul 2017 Posts: 312
|
Posted: Fri Sep 07, 2018 11:44 am Post subject: |
|
|
I activated already both options before:
CONFIG_INTEL_IDLE
CONFIG_CPU_IDLE_GOV_LADDER
to be on the safe side. So my results above are with those =y. _________________ ___________________
Regards
Spargeltarzan
Notebook: Lenovo YOGA 900-13ISK: Gentoo stable amd64, GNOME systemd, KVM/QEMU
Desktop-PC: Intel Core i7-4770K, 8GB Ram, AMD Radeon R9 280X, ZFS Storage, GNOME openrc, Dantrell, Xen |
|
Back to top |
|
 |
|