Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cpu Frequency Scaling - Intel 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
Spargeltarzan
Apprentice
Apprentice


Joined: 23 Jul 2017
Posts: 275

PostPosted: Tue Sep 04, 2018 12:35 pm    Post subject: Cpu Frequency Scaling - Intel P State Reply with quote

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
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 6614
Location: Saint Amant, Acadiana

PostPosted: Tue Sep 04, 2018 1:08 pm    Post subject: Reply with quote

You better add powersave, it will be used by pstates driver to scale down the frequency.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
P.Kosunen
Guru
Guru


Joined: 21 Nov 2005
Posts: 309
Location: Finland

PostPosted: Tue Sep 04, 2018 1:11 pm    Post subject: Reply with quote

Some kernels CPU Frequency scaling drivers need to be also enabled.
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 20123
Location: here

PostPosted: Tue Sep 04, 2018 1:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5745

PostPosted: Tue Sep 04, 2018 1:40 pm    Post subject: Reply with quote

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.
_________________
overlay | patches
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.
Back to top
View user's profile Send private message
P.Kosunen
Guru
Guru


Joined: 21 Nov 2005
Posts: 309
Location: Finland

PostPosted: Tue Sep 04, 2018 1:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
Spargeltarzan
Apprentice
Apprentice


Joined: 23 Jul 2017
Posts: 275

PostPosted: Tue Sep 04, 2018 2:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2519
Location: Near Toronto

PostPosted: Tue Sep 04, 2018 2:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
Spargeltarzan
Apprentice
Apprentice


Joined: 23 Jul 2017
Posts: 275

PostPosted: Tue Sep 04, 2018 2:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2519
Location: Near Toronto

PostPosted: Tue Sep 04, 2018 4:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1344
Location: Montréal

PostPosted: Tue Sep 04, 2018 5:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
Spargeltarzan
Apprentice
Apprentice


Joined: 23 Jul 2017
Posts: 275

PostPosted: Tue Sep 04, 2018 9:35 pm    Post subject: Reply with quote

@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
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2519
Location: Near Toronto

PostPosted: Tue Sep 04, 2018 11:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
Spargeltarzan
Apprentice
Apprentice


Joined: 23 Jul 2017
Posts: 275

PostPosted: Wed Sep 05, 2018 11:00 am    Post subject: Reply with quote

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 :roll:
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
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2519
Location: Near Toronto

PostPosted: Wed Sep 05, 2018 11:34 am    Post subject: Reply with quote

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
View user's profile Send private message
Spargeltarzan
Apprentice
Apprentice


Joined: 23 Jul 2017
Posts: 275

PostPosted: Wed Sep 05, 2018 12:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
P.Kosunen
Guru
Guru


Joined: 21 Nov 2005
Posts: 309
Location: Finland

PostPosted: Wed Sep 05, 2018 4:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
Spargeltarzan
Apprentice
Apprentice


Joined: 23 Jul 2017
Posts: 275

PostPosted: Fri Sep 07, 2018 11:44 am    Post subject: Reply with quote

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
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