power management and cpu governors :)

If it doesn't relate to Debian, but you still want to share it, please do it here
Message
Author
Deb-fan
Posts: 1042
Joined: 2012-08-14 12:27

Re: power management and cpu governors :)

#31 Post by Deb-fan »

Things like kernel config(timer interrupt + preemption) and process priority tuning are going to have a meaningful effect. Was dorking around with a keybind that'd renice Firefox when it's launched, giving it some preference in proc access. Still mostly on my 2-dork list as haven't gotten around to fully exploring what's possible. Much less core-pinning's potential etc. Though yeah these aspects have real tuning potential for any nixer wanting to really get best performance out of a given setup. Better core/thread performance. At lower or higher freqs.

Edit: Also do have to wonder how much of an adverse effect misconfig like this has on a really low level. If there's a process which actually needs preemptive and/or higher interrupt to work well, hammering away requesting cpu-time, with a voluntary preempt configged kernel saying no, no, no, no. Stuff like gaming or intensive audio tasks. Person may try something, get crappy results and just conclude it's crap on gnu/nix or consider a ton of other things before ever(if ever)considering hey the kernel I'm running isn't setup for desktop nix. Ok done folks, will leave off on this junk. It's on my things that make me go hmmmm list though. :)

Oops, one more quickie, so I know/think I and other mere mortals got it. This undervolting thing Intel pstate applicable chips. Built in thermal throttling (AMD must have similar) reducing the voltage to the chip, makes it run cooler, thus side-stepping the throttling, thus enabling it to run at a higher freq than it's rated for and/or "binned" at? Whew ... say that 3 times fast, I dare ya. :)
Most powerful FREE tech-support tool on the planet * HERE. *

User avatar
wizard10000
Posts: 193
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 16 times
Been thanked: 5 times

Re: power management and cpu governors :)

#32 Post by wizard10000 »

Deb-fan wrote:So you were able to get clock gains Wiz10k, by how much and do you feel comfortable enough with the arrangement to keep using it long term?
Hard to quantify, but I'll try :)

My i7-4800MQ has a base clock of 2.7GHz and a turbo frequency of 3.7GHz. At stock voltages I'll bump up against the processor's thermal limiter when maxing out only one core; with a -90mv undervolt I had all eight cores running at 3.3GHz during a 15-minute stress test. Fans ran at a medium speed during the stress test where without the undervolt fans would be screaming :)

I got hard lockups during stress testing at -100mv; -95mv worked fine but I decided to settle on -90mv. I'm extremely happy with the results.
we see things not as they are, but as we are.
-- anais nin

Deb-fan
Posts: 1042
Joined: 2012-08-14 12:27

Re: power management and cpu governors :)

#33 Post by Deb-fan »

A bottom line clock gain or think even just heat reduction with no freq impairment is still a benefit. Cool! You've got more ballz and familiarity than I do but will be keeping this in mind when get a proc later than turn of the century. ;)
Most powerful FREE tech-support tool on the planet * HERE. *

User avatar
wizard10000
Posts: 193
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 16 times
Been thanked: 5 times

Re: power management and cpu governors :)

#34 Post by wizard10000 »

CwF wrote:wow. Mine (desktops) are built semi passive with high thermal mass and it could take a half hour to reach 96C.
see if it's tripped

Code: Select all

cat /sys/devices/system/cpu/cpu0/thermal_throttle/package_throttle_count
Oh, I know it has without looking :)

Laptop cooling sucks; it's been about a year since the last time I blew the thing out and applied fresh thermal paste but it idles at 34C so I think cooling is reasonably healthy. JMO but on laptops the problem has almost always been how to get rid of the heat; even with the -90mv undervolt it only takes about five seconds to hit the thermal limiter during an 8-core stress test.
we see things not as they are, but as we are.
-- anais nin

Deb-fan
Posts: 1042
Joined: 2012-08-14 12:27

Re: power management and cpu governors :)

#35 Post by Deb-fan »

Woahhhhh, 34deg C!? Jebuz that's sweet and am jealous Wiz! Sounds like you're definitely a true geek(dedicated techie), am scared to even look in this old laptop's innards. No telling what I'd find. Jimmy Hoffa might be in there. :) The thought of reapplying thermal paste has flittered through my mind. Do you just rub stuff down with alcohol and put down a dab in middle of top of chip or what? Share thy chip pasty wisdom fellow nixer!?

On my bad, beast baby, it's got a bunch of hamsters on a wheel connected to the boxen. To overclock, I just have to put a pointy stick in there and jab em in the butt a couple good times. :P

Edit: Oops ... sorry CwF, didn't see what'd you'd said about zram. Have looked it over, got some mad-capped tweaking concepts which parallel what it does. Such is super secret at this point, don't even talk to myself about it yet, so mum's the word. :) You deal with a lot more complex set-ups than I do, clearly know what you're doing. I don't have access to that kind of hardware or application for it even if I did. In general though I go with no swap use, is best swap usage and any other frivilous disk i/o is evil incarnate and must be avoided and/or destroyed. Has to serve some meaningful purpose or it's my mission as a compulsive tweakster to eliminate any wasteful i/o.

Even with just 4gbs-ram, swappiness=10 set but would have to open 87 tabs or more in a somewhat tuned Firefox with Noscript to even see the swap start being used. That's what I want. Been considering going ahead and jumping up to 20. Why not? Though on non-tuned nix OS's with any untuned modern browsers and 4gbs, 10 maybe 15 seems right. Would still go w 10 the amount of memory untweaked browsers use now is ridiculous. Horrendous.
Most powerful FREE tech-support tool on the planet * HERE. *

User avatar
wizard10000
Posts: 193
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 16 times
Been thanked: 5 times

Re: power management and cpu governors :)

#36 Post by wizard10000 »

Deb-fan wrote:Do you just rub stuff down with alcohol and put down a dab in middle of top of chip or what?
Almost. The way I do it is clean with alcohol and apply evenly to CPU and heatsink with a razor blade. Too much thermal paste isn't a good thing either, so the trick is to fill the gaps between processor and heatsink. A translucent layer on both should work well.

edit: I had to reduce my undervolt a little bit - got hard lockup connecting to my Plex server so I reduced undervolt to -85mv.
we see things not as they are, but as we are.
-- anais nin

User avatar
pylkko
Posts: 1801
Joined: 2014-11-06 19:02

Re: power management and cpu governors :)

#37 Post by pylkko »

wizard10000 wrote:
CwF wrote:...Past that the lowest clock to get it done does save power.
If the number of cycles required to perform a task is fixed, how does a lower clock save power exactly? If clock frequency and power consumption are linear within a given CPU architecture (they are) doesn't running a slower clock just take more time to get the same job done?
Do you have some kind of source for that? Not an expert, but would presume that 1) there can be forms of thermal runaway, making it actually not linear to some degree. Also, in order to make the claim that you propose relevant, you would also have to take into account the time that the processor is idle, right? It might take twice as long to due something at twice the lower frequency, but what if you are not actually "doing anything" in the sense that only background daemons are running? Futhermore, switching the frequency probably has some overhead in itself, so how often and when you do it could have significant effects on power consumption. I have no idea how governors interact with so called dynamic frequency and voltage scaling, but when processors modulate the frequency and the voltage, this can save very considerable power, AFAIK. If you constrain the clock cycles to some limit, does the dynamic voltage also stay lower?
Last edited by pylkko on 2020-02-28 20:30, edited 1 time in total.

Deb-fan
Posts: 1042
Joined: 2012-08-14 12:27

Re: power management and cpu governors :)

#38 Post by Deb-fan »

34degs Wiz10k, your approach clearly works and only a true-techie would go to such lengths, doing that kind of maintenance that frequently. You take the state of your hardware seriously fellow nixer. :) This thing's idling mid 40's, doesn't take much to push it to low-mid 50's either. Still well within tolerance and kinda surprised. Thermal paste must look like it's fossilized in there. Scared to even look. :P

Seemed like you were pushing the undervolting a bit far but then you have hands on with that type of thing. Ive forgotten anything I'd learned about oc'ing, didn't follow through and a big part of that was the dire warnings encountered plus a nice dash of laziness. Probably from mostly clueless peeps too. Hearing from techies like yourself and Stevep does give a boost in confidence. Going to learn and take more interest in it now. Why the heel not? Cool stuff ... yep, thanks for bringing it up and giving some good info fellas.
Most powerful FREE tech-support tool on the planet * HERE. *

User avatar
wizard10000
Posts: 193
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 16 times
Been thanked: 5 times

Re: power management and cpu governors :)

#39 Post by wizard10000 »

pylkko wrote:
wizard10000 wrote:
CwF wrote:...Past that the lowest clock to get it done does save power.
If the number of cycles required to perform a task is fixed, how does a lower clock save power exactly? If clock frequency and power consumption are linear within a given CPU architecture (they are) doesn't running a slower clock just take more time to get the same job done?
Do you have some kind of source for that? Not an expert, but would presume that 1) there can be forms of thermal runaway, making it actually not linear to some degree. Also, in order to make the claim that you propose relevant, you would also have to take into account the time that the processor is idle, right? It might take twice as long to due something at twice the lower frequency, but what if you are not actually "doing anything" in the sense that only background daemons are running? Futhermore, switching the frequency probably has some overhead in itself, so how often and when you do it could have significant effects on power consumption. I have no idea how governors interact with so called dynamic frequency and voltage scaling, but when processors modulate the frequency and the voltage, this can save very considerable power, AFAIK. If you constrain the clock cycles to some limit, does the dynamic voltage also stay lower?
There are many references but here's one that's not too technical - https://www.researchgate.net/figure/CPU ... _254017286

We're assuming fixed voltage here; you're absolutely correct that lower voltage at a lower clock speed would save power.
we see things not as they are, but as we are.
-- anais nin

User avatar
pylkko
Posts: 1801
Joined: 2014-11-06 19:02

Re: power management and cpu governors :)

#40 Post by pylkko »

We're assuming fixed voltage here; you're absolutely correct that lower voltage at a lower clock speed would save power.
Yes, but isn't that a "mistake"? This will not be the case in modern processors, right?. I mean, the so called "dynamic voltage", not the static part that the user can sometimes adjust by undervolting.

But the main reason, I guess, that mobile devices use governors to keep the power consumption down relates to increasing the "online time". Users don't like to drop of the network on their phone, even if it means that things get done slower. The manufacturers presume that the users do not have a "task" to do (in the sense that you use the word in your example - compiling a large software suite.). They presume that the processor is idle 95% of the time or more.

If this all is true, then the question about whether a governor on a Debian laptop (for example) makes sense, depends on which use case is more typical. Maybe for most users their laptop is used more like a phone than compiling massive sets of stuff all the time.

Deb-fan
Posts: 1042
Joined: 2012-08-14 12:27

Re: power management and cpu governors :)

#41 Post by Deb-fan »

P governors, which are capable (not performance) adjust based on workload, so doesn't matter what a given user is doing. In the case of ondemand (my preference) such things are highly tunable. Something a user can control, like voltage applied which have predictable effect on core temps and allow higher freqs also clearly very significant. Not even sure what you're trying to say or get at, shrugs.

To me this, in ways reflects poorly on Intel too. Suggesting a run of chips they know are quite capable of much higher freqs, that they fiddle with this thermal throttling, microcode, pstate driver (applied voltage), whatever to cap some out at lower freqs and charge folks more/less for the same chips. While certainly not illegal, not even really unethical, still kind of shady practice and personally I fully believe all this side-channel business was no oversight or mistake personally. Aka: Think was purposely built in and those in the "know", knew about it for a long time before they got busted. That's a whole nother thing though. Blah blah. In this at the end of the day techies who learn about this undervolting deal can get decent freq gains or other bennie's out of such knowledge and that's pretty cool. :)
Most powerful FREE tech-support tool on the planet * HERE. *

User avatar
wizard10000
Posts: 193
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 16 times
Been thanked: 5 times

Re: power management and cpu governors :)

#42 Post by wizard10000 »

pylkko wrote:Yes, but isn't that a "mistake"? This will not be the case in modern processors, right?. I mean, the so called "dynamic voltage", not the static part that the user can sometimes adjust by undervolting.
There are tools out there that can undervolt each p-state with a different value - for Android there's EX Kernel Manager (requires root) :)

Not positive but I *think* intel-undervolt applies the same undervolt setting to each p-state.
we see things not as they are, but as we are.
-- anais nin

Deb-fan
Posts: 1042
Joined: 2012-08-14 12:27

Re: power management and cpu governors :)

#43 Post by Deb-fan »

Have a tendency to root for the underdog. Hoping to see AMD moving to make the best of this Intel Trainwreck. :)

Bigwig @ Google Inc calls some higher up at AMD, yeah ... We'd like to place a standing order. Seems Intel's been selling us chips with serious built in exploits for 20yrs. Yeah write this down ...

Person @AMD: YOU want HOW many truckloads of chips,. Errr, could you repeat that, this phone must not be working properly. :P
Most powerful FREE tech-support tool on the planet * HERE. *

CwF
Posts: 1091
Joined: 2018-06-20 15:16

Re: power management and cpu governors :)

#44 Post by CwF »

wizard10000 wrote:
pylkko wrote:

wizard10000 wrote:

CwF wrote:
...Past that the lowest clock to get it done does save power.



If the number of cycles required to perform a task is fixed, how does a lower clock save power exactly? If clock frequency and power consumption are linear within a given CPU architecture (they are) doesn't running a slower clock just take more time to get the same job done?

Do you have some kind of source for that?
It thought I said that, it's not linear. I ask earlier to stevepusser if max clock reaches max voltage when undervolting, didn't get an answer. I suspect it does. Every clock step is at a voltage step. Every voltage step higher runs slightly less efficient. The voltage is not static. There is a voltage to clock table, undervolting starts of on a lower rung and steps up to increase clock like normal.

User avatar
wizard10000
Posts: 193
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 16 times
Been thanked: 5 times

Re: power management and cpu governors :)

#45 Post by wizard10000 »

CwF wrote:The voltage is not static.
Yeah, I learned a lot about p-states from this thread :)
CwF wrote:I ask earlier to stevepusser if max clock reaches max voltage when undervolting, didn't get an answer.


I ran a stress test against a single core using a -80mv undervolt - processor is an i7-4800MQ with a base clock of 2.7GHz and a turbo frequency of 3.7GHz, during the stress test the single core ran at 3.7GHz and the other seven cores ran at 3.5GHz. CPU temp remained steady at 84C (better than before, I can hit the thermal limiter with a single core at stock voltage).

edit: I had to back it off a tiny bit more, Deb-fan; -75.2mv now and my idle temp has gone up to 37C but that's a lot better than the 43C idle I had before undervolting :)
we see things not as they are, but as we are.
-- anais nin

Deb-fan
Posts: 1042
Joined: 2012-08-14 12:27

Re: power management and cpu governors :)

#46 Post by Deb-fan »

That's still fairly bad arse Wiz10k and those temps are still well within tolerance. :) Stands to reason a beast of a heatsink or cooling system may complement this undervolting (thermal throttling) situation too. Not sure what's practical in that for a laptop outside of what you're doing already. Have never really checked what methods of stepping up heat dissipation on laptops are being used. People with 6 fans and a liquid cooled system on a desktop pc. Such has always seemed excessive to me, well out of my league. Things throughout this thread taught or clarified a lot of cpu-core related things for me too. Thanks guys ...

Intel is apparently behind this Clear OS distro and all the patchery they're applying to the Linux kernel is apparently causing real improvements in performance. Compared to others ... Considering Intel's been, still is the premiere cpu manufacturing people in the world, pretty much since there's been cpu(s)am sure they've got people with knowledge unequaled on the subject, other technology too. Still AMD's people must not be slouches either, they've been holding their own and staying competitive with a much larger entity forever themselves and Google Inc same .... Last time I'd bothered checking, was making in excess to 20 billion per/Yr in revenues, no doubt that's increased since then as they're always expanding and absorbing new things. Those kind of resources have to buy some of the top tech talent in the world and even with that, still took quite some time before these "flaws" in Intel's design architecture came to light.

Again I think came to light means, well fellas, didn't think it'd ever happen but we finally got busted, was a good run while it lasted though ... 10-15yrs, damn those pesky software engineers at Google! No worries, in this type of thing the waters so murky/muddy by this point, nobody will ever be able to point a finger, it was a "design flaw" afterall. Oops ... sowwie. Meanwhile xyz-govt/Corp has been spying it's booty off or someone's been siphoning off who knows how many gazillions of bucks on the worlds stock markets or whatever else that whole time. :D

Truthfully all this stuff makes me inherently less trustful of Intel's gear. Though because I prefer doing so (buying older hardware), next system will likely end up being Intel based too. Am not going to raise my nose in the air if come across a 3rd/4th gen i5 or i7 at a good price etc. Will snatch it up and begin tweaking hades out of the system per usual. Every now and then, less so lately, I still try to research the Intel vs AMD situation and see who has what, what's the best thing going on in the chip market. Did so last night ...

Ah this chip from Intel is the best choice in performance ... Has this, has that, these things ... pricetag of only $2,999. :P Could put together 10 super-lightspeed space beast systems just for the cost of that chip. Don't believe Intel overly cares about this undervolt affair, still only ever going to be a minority who bothers with it. The base premise just sounds odd and majority of people will stay away. Fiddling around with the current in an electronic component. Yep you just set your mobo so that the chip get's less voltage than the manufacturer sets it up for and whala ... It runs xyz faster because xyz does xyz and the xyz thermal thingy's. Avg person(pc user), errrr yeah, that's great, please step away from my computer now. Yeah ... sounds awesome, stop pushing buttons on my $750 buck computer. YEP ... GREAT, stop touching that!

Used to do that to family/friends, come over and absent mindedly be sitting there tweaking settings on their pc's, disabling default services running on windows, that are known security issues etc. Had to curb the impulse to tweak this junk and strictly confine that to stuff they couldn't ever possibly use etc. :P
Most powerful FREE tech-support tool on the planet * HERE. *

User avatar
stevepusser
Posts: 12397
Joined: 2009-10-06 05:53
Has thanked: 6 times
Been thanked: 4 times

Re: power management and cpu governors :)

#47 Post by stevepusser »

Here's a little screencast gif (made with Peek) of part of my XFCE taskbar in MX 19 right now as all twelve threads are at 100% use compiling the Pale Moon browser update packages.

Image

Left to right are
  • the network down-up (streaming some music) in the hardware-monitor plugin
  • wmhdplop in the wmdock plugin showing hard drive use in a colorful way
  • wmtemp in the wmdock plugin (top is CPU temp in F, don't really know what the SYS is, but the readings are always close)
  • RAM use (top) and swap use bottom (showing a leftover hibernation file from the last time I hibernated the machine), in the hardware-monitor plugin
  • CPU speed
  • CPU use--twelve narrow bars are per core, and the thicker one is overall
The speed is 3.90 GHz for about the first 15 seconds when all are 100%, but then the BIOS drops it down to 3.60. Without undervolting, those values are 3.60 and 3.20. When I first got the Optimus laptop, I couldn't get Bumblebee working, so the Nvidia discrete GPU was always turned on and eating power, so the maximum speed under sustained stress was even lower: 2.80 GHz, which was very disappointing. Later on I got Bumblebee and undervolting working, so the Nvidia GPU is off unless I want it running, and speeds are good.

The MSI also has a undocumented way to unlock the BIOS settings to access all kinds of advanced features, including changing a voltage "slope" setting so it can run at 3.90 GHz all day at 100%, but I didn't like the 93-94 C CPU temperatures I was getting, so reverted that.
MX Linux packager and developer

User avatar
wizard10000
Posts: 193
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 16 times
Been thanked: 5 times

Re: power management and cpu governors :)

#48 Post by wizard10000 »

stevepusser wrote:I couldn't get Bumblebee working, so the Nvidia discrete GPU was always turned on and eating power...
Having some difficulty with it myself - I can boot with Intel graphics but for some reason I lose my laptop keyboard when I do and this doesn't happen with nouveau or proprietary Nvidia drivers. I also lose compositing but am less worried about that :)
we see things not as they are, but as we are.
-- anais nin

User avatar
stevepusser
Posts: 12397
Joined: 2009-10-06 05:53
Has thanked: 6 times
Been thanked: 4 times

Re: power management and cpu governors :)

#49 Post by stevepusser »

wizard10000 wrote:
stevepusser wrote:I couldn't get Bumblebee working, so the Nvidia discrete GPU was always turned on and eating power...
Having some difficulty with it myself - I can boot with Intel graphics but for some reason I lose my laptop keyboard when I do and this doesn't happen with nouveau or proprietary Nvidia drivers. I also lose compositing but am less worried about that :)
I'm using the filthy tainted "bumblebee-nvidia" with this laptop. We didn't even try to get bumblebee-nouveau working with the MX Nvidia installer (please don't tell RMS!)
MX Linux packager and developer

Deb-fan
Posts: 1042
Joined: 2012-08-14 12:27

Re: power management and 'cpu governors :)

#50 Post by Deb-fan »

^ Lmao :) ... Yep, like you don't clearly already know, mid 90's temps would make any techie nervous. Output of sensors having long been informing me 100deg is "critical" would be uncomfortable ever seeing it anywhere close for long. Much less for a sustained period, though you know what's possible, more so than most with application/experience. Would be fiddling and twitching if temps hit those ranges. Also been stringently evading proprietary graphics drivers, will cross that bridge when I have to. :)

Funny post tweaking someone else's pc call back:

Errrrrrr yeah seems to work much better/faster in general, just can't print anything.

Me: Damn you, stupid spooler service!!! :P Why wouldn't it auto launch when needed!? Stupid thing! Oops, over tweaking, will fixy. My fault. :)
Most powerful FREE tech-support tool on the planet * HERE. *

Post Reply