Page MenuHomeSolus

Fix CPU governor selection
Closed, ResolvedPublic

Description

Solus runs in the performance governor per default and never switches to an energy efficient gov.

Ubuntu for instance uses a script thats run at Boot time.
It lets the system Boot in performance, checks what cpufreq driver is loaded and changes to ondemand in non-intel-pstate and powersave in intel-pstate systems.

Event Timeline

DataDrake triaged this task as Wishlist priority.Sep 16 2016, 1:30 AM
ikey changed the task status from Open to In Progress.Apr 13 2017, 7:19 PM
ikey claimed this task.

IMO not using intel_pstate is not a wise idea.
With my CPU using the old ondemand governor is terrible.

It would be ondemand in pstate or cpufreq, the userspace side doesn't need to know about that, cpupower does.
And we have a few days to test it. If intel_pstate turns out to be needed, sure, we'll turn it back on. But I'd rather
know than guess and hope its the best option.

Also should point out we've been using ondemand in pstate now for months :)

ikey raised the priority of this task from Wishlist to High.Apr 13 2017, 8:19 PM

These governor changes are merged as of https://git.solus-project.com/packages/linux-lts/commit/?h=linux-lts-4.9.22-15

If we hit regressions, we'll immediately revert pstate change. I'm gonna keep this issue open to track it

There is no ondemand in pstate.
Pstate only supports powersave and performance.
Where powersave is the "better" ondemand.

My system is running powersave via pstate as it should after a recent reinstall.

Yknow what I meant, cut me some slack I've barely slept in 3 days :P
Anyway, it still needs testing. Blind faith isn't enough.

Yeah i guessed what you mean.
Could you please wait with that pstate drop?
I would like to run a few benchmarks, cpufreq vs. pstate.
Give me a few hours.

Well its only in unstable, so it won't hit you in stable at all. So yeah by all means please do. In the mean time I can be rebuilding and fixing the rest of the archive so its then safe to update on unstable there
Sound good? Thanks :)

I've added a simple change here that will allow the system to use either intel_pstate or cpufreq and select the correct governor setting:

https://github.com/solus-project/solus-hardware-config/commit/5dff5db1f4b22f3462a02a8071b615551c4f12e6

(note: This is a testing release, it's not YET active)

Done, i thought it would be much worse.
I tested the old cpufreq driver some weeks ago for gaming and had the impression that everything felt less responsive and sluggish.
But the raw numbers at least are quite similar.

intel_pstate https://browser.geekbench.com/v4/cpu/2528775

				https://rbn.gr/screens/1492117572-f5135ee69af5cb54e92edf1241904edba2f53e77.png

cpufreq https://browser.geekbench.com/v4/cpu/2529028

				https://rbn.gr/screens/1492119155-f31df3493b01a1dd0b3bf0a1dd0330be886ff996.png

Was this powersave vs ondemand? Also thank you for compiling those

Also opinion on feel and preference on which is better would be considered :]

Yep, it was cpufreqs ondemand vs. intel_pstates powersave.

I prefer using pstate as it is superior over cpufreq. Especially in situations where the turboboost is used.

There are a few articles on phoronix about this topic.

Sure but there are issues known with pstate making it buggy in some configurations, like not entering
lower sleep states, overstressing, etc. If there is something about it being legit-ok in 4.9 then sure, can
include it. But I also need to consider stability

I have been using pstate over the past years, had no issues with it. Not on the desktop and not on my servers with some of them hitting 100+ days uptime.
And considering not to use pstate at all is a step backwards imo.
There is a pretty good reason why pstate is being used if possible.

The reason it's being used is because I initially enabled it :P I'm also not interested in hypotheticals and reasonings, but cold, hard facts :)

Sidenote: I've called upon another couple of people and then I'll effectively curate a vote result from all responses :P (Daily Solus users)

Ugh, my CPU doesn't like cpufreq either @robingroppe. On your advice (and my local testing) - back we go.

OK so as part of the *previous* commit we did set in https://git.solus-project.com/packages/linux-lts/diff/files/config?h=linux-lts-4.9.22-15:

+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y

In drivers/cpufreq/intel_pstate.c this is respected and will yield the performance defaults we're looking for (performance governor by default)
Additionally, with solus-hardware-config, we'll now enter powersave with intel_pstate when we reach multi-user.target, and for non pstate
systems we'll enter ondemand with cpufreq.

ikey closed this task as Resolved.Apr 13 2017, 11:40 PM

OK now in unstable repos: https://git.solus-project.com/packages/linux-lts/commit/?h=linux-lts-4.9.22-16
Back to pstate, we have performance by default, and dynamically select ondemand/powersaver as appropriate.
Marking resolved :P Thanks for help/feedback