Change Power Scaling Governor - Permanently -

If none of the more specific forums is the right place to ask

Re: Change Power Scaling Governor - Permanently -

Postby CwF » 2020-09-19 21:10

After finding the available option as said by hoas you can enable your settings in /etc/sysfs.d. The folder may be absent, create it and create the file cpupolicy.conf with the echo line. Generally, any package that enumerates something in sysfs can be user modified on boot in sysfs.d

older cpufrequtils depricated example
Code: Select all
# etc/sysfs.d/cpupolicy.conf
#mode #devices/system/cpu/cpufreq/ondemand = 644
#devices/system/cpu/cpufreq/ondemand/up_threshold = 50
#devices/system/cpu/cpufreq/ondemand/ignore_nice_load = 1
#devices/system/cpu/cpufreq/ondemand/sampling_down_factor = 10
#devices/system/cpu/cpu0/cpufreq/scaling_governor = ondemand
#devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 1600000
#devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 3601000
#devices/system/cpu/cpu1.....
CwF
 
Posts: 790
Joined: 2018-06-20 15:16

Re: Change Power Scaling Governor - Permanently -

Postby Head_on_a_Stick » 2020-09-19 21:32

^ Nice!

stevepusser wrote:FUD about how dangerous undervolting could be

Undervolting isn't dangerous if done correctly but misconfiguration of CPU voltage settings can most certainly damage the hardware.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12650
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Change Power Scaling Governor - Permanently -

Postby Deb-fan » 2020-09-19 21:47

It's DEPRECATED, deprecated ... dammit ! Noticed you'd (@CwF) misspelled it in a thread about gksu/do being deprecated too. Mostly being a dork, cool info thanks for sharing. :)
Most powerful FREE tech-support tool on the planet * HERE. *
Deb-fan
 
Posts: 954
Joined: 2012-08-14 12:27

Re: Change Power Scaling Governor - Permanently -

Postby stevepusser » 2020-09-19 21:57

Head_on_a_Stick wrote:^ Nice!

stevepusser wrote:FUD about how dangerous undervolting could be

Undervolting isn't dangerous if done correctly but misconfiguration of CPU voltage settings can most certainly damage the hardware.


Yes, it's best to try and find some Windows user that's already done the trial and error work to determine the optimum settings for your machine. Let them be the guinea pigs. :D
MX Linux packager and developer
User avatar
stevepusser
 
Posts: 12083
Joined: 2009-10-06 05:53

Re: Change Power Scaling Governor - Permanently -

Postby CwF » 2020-09-19 22:03

Deb-fan wrote:It's DEPRECATED, deprecated ... dammit !

danke. I try.
CwF
 
Posts: 790
Joined: 2018-06-20 15:16

Re: Change Power Scaling Governor - Permanently -

Postby Deb-fan » 2020-09-19 22:47

^ :D You definitely speak way better English, than i do German fellow nixer. Also lmao @stevep, like how you think, let windows users crash test stuff. :D What you, CwF and wizard10000 have commented on regarding undervolt certainly reawakened an interest in such topics. It was overclocking back when last researched. An assoc system tweak which is supposed to be very safe, RAM overclocking, have you messed with that and .. ?

Would think they'd compliment each other, undervolt procs + overclock ram. Gains folks are reporting make it seem silly not to explore these things. Also noted seems silly to cripple cores w a power governor which never let's them hit their potential. Showed in one link, vast majority of the time using ondemand cores stayed at min freq anyway.

When time comes to hit the gas pedal, want my pc's to go faster. With a crippling governor, kinda like buying a ferrari and capping the throttle out @65mph, shrugs.
Most powerful FREE tech-support tool on the planet * HERE. *
Deb-fan
 
Posts: 954
Joined: 2012-08-14 12:27

Re: Change Power Scaling Governor - Permanently -

Postby CwF » 2020-09-20 00:27

Deb-fan wrote:RAM overclocking, have you messed with that and .. ?

No. since I don't run laptops I don't have the same performance limits. I overbuild for performance and limit for silence. Maybe an entirely different goal. For the most part I use the bios instead of run times. I usually have an amount of memory that often limits speed. I like more of fast enough rather than faster and almost enough...
CwF
 
Posts: 790
Joined: 2018-06-20 15:16

Re: Change Power Scaling Governor - Permanently -

Postby sgosnell » 2020-09-20 01:15

Would think they'd compliment each other
It's COMPLEMENT. :P
Take my advice, I'm not using it.
sgosnell
 
Posts: 864
Joined: 2011-03-14 01:49

Re: Change Power Scaling Governor - Permanently -

Postby Deb-fan » 2020-09-20 02:27

^ LMFAO! :D

@CwF makes perfect sense. Still OC'ing, undervolting and memory overclocking are pretty interesting subjects, due to the binning process you explained one time it's got to almost be considered a why-the-hades not do it or at least try proposition.

Did a quick search on oc'ing ram and one of the things which popped up in the top results is a link from Intel, bunch of info on it, showed some good gains too and linked to a basic overview of some info on oc'ing their cpu's as well. Meaning it's more or less officially endorsed. Certainly same will go for AMD chips and chipsets.

So cant see anything wrong w over building but surely cant see anything wrong w getting an easy, safe boost from what someone already has either. :)
Most powerful FREE tech-support tool on the planet * HERE. *
Deb-fan
 
Posts: 954
Joined: 2012-08-14 12:27

Re: Change Power Scaling Governor - Permanently -

Postby stevepusser » 2020-09-20 07:19

Deb-fan wrote:^ LMFAO! :D

@CwF makes perfect sense. Still OC'ing, undervolting and memory overclocking are pretty interesting subjects, due to the binning process you explained one time it's got to almost be considered a why-the-hades not do it or at least try proposition.

Did a quick search on oc'ing ram and one of the things which popped up in the top results is a link from Intel, bunch of info on it, showed some good gains too and linked to a basic overview of some info on oc'ing their cpu's as well. Meaning it's more or less officially endorsed. Certainly same will go for AMD chips and chipsets.

So cant see anything wrong w over building but surely cant see anything wrong w getting an easy, safe boost from what someone already has either. :)


I did try boosting RAM speed once on the MSI laptop, since it has a undocumented cheat code that unlocks all kinds of advanced and mysterious settings in the UEFI setup, but I must have done something wrong, because it then wouldn't boot at all. dmidecode and forum posts claimed it shipped with 2600 speed chips which were underutilized by the default 2400 speed setting, though.
MX Linux packager and developer
User avatar
stevepusser
 
Posts: 12083
Joined: 2009-10-06 05:53

Re: Change Power Scaling Governor - Permanently -

Postby Deb-fan » 2020-09-21 06:47

Things have definitely come a long way. When looked this subject over seemed like doing it was 2 parts black magic + 12 parts techno-wizardry and a few other parts thrown in for good measure. People could end up with extra parts or got to keep all the parts if things went horribly wrong. Now believe (more like know) a big part of why these things got such a bad reputation is as in so much else, general pebcak nonsense.

People too lazy, stupid or both who never learned enough about something to have any clue what they're doing, tried doing it anyway, got bad results and filled the world with FUD. The folks who pioneered such hardware hackery and actually knew their stuff were consistently getting impressive results, shrugs. :)
Most powerful FREE tech-support tool on the planet * HERE. *
Deb-fan
 
Posts: 954
Joined: 2012-08-14 12:27

Re: Change Power Scaling Governor - Permanently -

Postby Deb-fan » 2020-09-21 12:25

Really flogging a dead horse, there's something for everyone when comes to getting this thing done, that being setting and/or changing a default power governor in this thread. Still being a dork and wanting to turn it into a more useful resource for folks who might be searching out this type of info, anyway continuing on blahblah.

Noted: Linked to something showing that even with the default power governor used on many systems = ondemand, that my cores are staying at lowest freq vast majority of the time and that's with jacked up reconfig's beyond the crappy defaults ondemand uses. My system's cpu-cores are set to increase freq's and stay there longer under a much lower load than the defaults. The point that should make painfully obvious, if someone changes over to powersave in an ignorant attempt to conserve battery, not only are they going to have crappier performance when the pc is under load, they could very well end up using as much or even MORE power.

Generally speaking a proc running at a higher freq gets tasks done more quickly, thus smoothly. Whereas a proc capped out at a much lower freq is still going to have to complete those tasks only it's going to take it longer with a less smooth user experience at lower performance. Main thing is that's stupid, even if it's mostly going to be expressed by degrading the systems performance, it's still not a good thing. While noted don't want cores running at full throttle @ all times as would be the case while using ie: peformance, thanks to this miraculous freq scaling thingy those procs can step things up when needed and drop back down when appropriate too. All the while still giving someone good performance and conservation of battery.

In fact learned much since that old tute and am now considering adopting the conservative govenor over ondemand. Still have research to do though. That's something which might not be readily apparent about ondemand's design, its name is misleading, would seem logical to think well I've got this range of freq's thus ondemand will use the right one, based on well errrr, demand ... right ? Nope, doesn't work that way, when x-load is reached it skips right to the top freq and stays there for however long its config'ed to. While also noted these can be tuned but still the conservative governor is more like what I'm after in terms of how it works, it will gradually step up through available freq's till it hits the one which is right for xyz-workload. Drop back down when not. Having something as cool as freq scaling and not using it is foolish me thinks.

Convervative can also clearly be tuned to ridicoulous extent and jmo, given a system where the p_state = Intel's governor is available then will very likely use it, who is better able to design a governor which works best, scales best under-load and is integrated best with gnu/Nix, the Intel firmware and drivers for the hardware involved, than Intel themselves ? Am going to go out on a limb and conclude Intel probably knows a bit about INTEL's chips, lol. Will still have to test and see for myself when time comes and also mentioned for me on the vast majority of hardware it'll be ondemand or conservative governors used default(tweaked of course.)Though @stevep clearly favors using it (Intel's thingy) on his hardware for a reason and undervolting a proc done properly ... is clearly awesome imo.

Also hope I've pointed out the obvious when it comes to conserving battery there are MANY more relevant areas to consider than the damn power governor and core-freqs. Calling such things a power governor is kind of misleading in my mind too. Suggests a much more important role and much simpler solution than what's actually involved. Stuff like using a friggin windows manager and other lighter alternatives out of the legions available for ANYTHING in gnu/Linux, than say opting for Gnome with everybit of eyecandy enabled in it on your laptop etc etc etc. Am not a guru on any of this, just saying a little common sense and some googling goes a longgggggggg way peeps. :D

Ps, crap all this typing for something a person should've easily answered with 10-15mins of googling. Still have already spent the time and hopefully some interesting, useful tidbits for whomever, perhaps mark the thread with 40 solutions to your question as [SOLVED] OP ??? There you have it done with this dorkishness. :P
Most powerful FREE tech-support tool on the planet * HERE. *
Deb-fan
 
Posts: 954
Joined: 2012-08-14 12:27

Re: Change Power Scaling Governor - Permanently -

Postby Deb-fan » 2020-09-21 16:08

DAMMIT in for penny, in for pound, more dorkness !!! DAMMIT, DAMMIT !!! :D

My views on proper settings in terms of tuning ondemand have much changed too. That being, while in that old tute demonstrate increasing min freq, same applies to capping max, those are easy enough done without cpupower or the outdated cpufrequtils programs of course, stopped using them a long time ago. Not that there's anything wrong with something like cpupower, wasn't well doc'ed when I was first playing with this, neither was customizing settings and reconfig'ing ondemand. That stupid tute had to be one of the better on the topic then and still useful bits. Seems things are better explained now as regards ondemand. Sighs ... anyway. Since linked the thing, felt obligated to type some more on this.

Just some preferences, I WANT the cores at lowest freq when higher one's aren't of benefit, so got rid of all that stepping up the min freq to a higher one jazz, also currently have up_threshold at 30(%), sampling_rate at 250000 ( 1/4th of a sec) and sampling_down_factor at 4, all this means ondemand checks cpu-load 4 times per sec, if it's at 30% or greater hits the gas pedal and pushes the cores up to max freq, it stays there for 1sec, 250000 x 4 = 1 second, then rinse + repeats the thing. With the way I use my system, this works well. Yeppers system is very responsive, also as desired the cores are running at lowest freq, nice and cool like 80% of the time too. So even though I'm on AC so don't much care about it, if I were on battery would still be a great balance of performance and conserving battery charge.

More elaboration, why not ? :P Imo, powersave is fairly well useless, though something like performance certainly has a place, mostly among gamers, it's a simpler ... what I'm going to term dumb governor. It has one job, mash the gas pedal and keep it there until the system admin/user changes that. In the context of gaming, yeah of course ondemand is going to come up short, it's got extra overhead, it's checking loads, shifting around freqs etc. Thusly out-of-box (even tuned) it's not going to give the same consistent performance as the thing called performance. While I could do some basic hacking, like echo'ing the max freq to the file which sets the minimum freq the system will use, in other words could mimick it being the performance governor, with the minimum freq set @ the max the procs can do, it'll stay at max-freq. Never down shift. Though it'd still amount to some(poss tiny)extra overhead thus won't get as good as performance and it'd be easier to set cores to using the performance governor while gaming and then switch back to ondemand for everyday computing.

Clearly similar hackiness could make ondemand behave like the powersave governor but why and also lose out on benefits of core freq scaling altogether and taking the performance hit that entails ? Again all to save next to nothing in voltage ? Errrr ... if that's what xyz-nixer thinks best, sure ... go for it.

PS, btw that is one BIG downside to using a power governor that's got so dang many things a person can fiddle with, someone could easily find themselves forever screwing around with them, hmmmm, ah ... gonna change this, that. What if I set the up_threshold here, ... no, there ? Obviously if a person employs some basic reasoning, collects some stats on how they use their system on avg, they can then fine tune these things to find an overall sweet spot for themselves.

Though don't be surprised if you keep screwing with it anyway. I'm probably changing all the above mentioned preferences as you're reading this, :P
Most powerful FREE tech-support tool on the planet * HERE. *
Deb-fan
 
Posts: 954
Joined: 2012-08-14 12:27

Re: Change Power Scaling Governor - Permanently -

Postby Deb-fan » 2020-09-22 15:19

Same deal, typed something ... so feel need to clarify related junk.

Stuff noted above when it comes to fiddling with the ondemand governor, is only intended to be very broad overviews of the ideas and things which could be done, noted also, it's virtually friggin endless. Which also hope established that proper adjustments can be VERY hardware + user dependent. For example if I had a beast of a processor with 4-8-12 cores running @ already ridiculous base freqs, realistically almost NOTHING should ever push that system to a 95% core-load(ondemand's default up_threshold), if it ever did/does in context of desktop Nix, something is probably very wrong, anyway thusly with defaults it forever stays at lowest freq unless adjusted, increasing min freq can be useful and cool too but with ondemand's chitty defaults a monster cpu is never going to stretch it's legs, thusly what the hades is even the point of having such a $etup ?

Lastly, a cleaner approach to the weirdness touched on above, getting ondemand to act like the performance governor, this could be done multiple ways other than setting the min freq allowed on a given system to the max freq, could also simply be echo'ing a high sampling_down_factor multiplier or whichever too. Given the settings I've currently got by way of clear example, that's 1sec with it set at 4, could just set it to say 10000, doing the math, 40+ mins before ondemand bothers seeing if it should step freq back down. So once that puppy pops to top-end freqs, would stay there for a good long time, thus although I'm not going to bother testing it, I don't game, don't have an install setup for anything like that, it would be interesting to see how ondemand would stack up in such a situation against the performance governor while gaming etc. @Head_on care to take that Ryzen for a spin in this ??? :D

Yeppers switching it back, would just be echo'ing whatever sane value that to the relevant file, wham, it's done pretending to be the performance governor. Just to make something which should already be painfully clear by this point, painfully clearer, lol. As many ways as ondemand can be re-config'ed and ability to easily set min/max freqs, switching to many other governors could be rendered pointless. Mostly just trying to share some interesting junk I've found, make folks aware and get people thinking about cool stuff they can do w such info.

When figured such nonsense out, thought WTF, WTF didn't anyone tell me this !!! This damn thing is the default in majority of gnu/Nix ?!?!? Errrrr, now you can't say that. :)

Ps, also added what I think is a cool approach to allowing user set ( no passwd)on-fly governor switching. Of course that's in the Tips n tricks section of forum.

Oops, ps2 ... Given someone who knows what they're doing am about 100% sure gnu/nix could get better battery than windows. Some tektard, "oh man linux gets chitty battery", screens jacked up so bright they have to wear sunglasses to use the laptop. :P
Most powerful FREE tech-support tool on the planet * HERE. *
Deb-fan
 
Posts: 954
Joined: 2012-08-14 12:27

Re: Change Power Scaling Governor - Permanently -

Postby Head_on_a_Stick » 2020-09-22 18:58

Deb-fan wrote:Same deal, typed something ... so feel need to clarify related junk

Please learn to use the edit button... :roll:

You do understand that these boards are donated by a generous Debian developer, right? Your rambling, lengthy, nonsensical, multiple posts could be considered an abuse of that generosity.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12650
Joined: 2014-06-01 17:46
Location: /dev/chair

PreviousNext

Return to General Questions

Who is online

Users browsing this forum: No registered users and 18 guests

fashionable