power management and cpu governors :)

If it doesn't relate to Debian, but you still want to share it, please do it here

Re: power management and cpu governors :)

Postby Deb-fan » 2020-02-28 04:19

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. :)
Deb-fan
 
Posts: 708
Joined: 2012-08-14 12:27

Re: power management and cpu governors :)

Postby wizard10000 » 2020-02-28 11:55

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
User avatar
wizard10000
 
Posts: 145
Joined: 2019-04-16 23:15
Location: southeastern us

Re: power management and cpu governors :)

Postby Deb-fan » 2020-02-28 12:16

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. ;)
Deb-fan
 
Posts: 708
Joined: 2012-08-14 12:27

Re: power management and cpu governors :)

Postby wizard10000 » 2020-02-28 12:49

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
User avatar
wizard10000
 
Posts: 145
Joined: 2019-04-16 23:15
Location: southeastern us

Re: power management and cpu governors :)

Postby Deb-fan » 2020-02-28 13:16

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.
Deb-fan
 
Posts: 708
Joined: 2012-08-14 12:27

Re: power management and cpu governors :)

Postby wizard10000 » 2020-02-28 19:30

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
wizard10000
 
Posts: 145
Joined: 2019-04-16 23:15
Location: southeastern us

Re: power management and cpu governors :)

Postby pylkko » 2020-02-28 20:26

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.
User avatar
pylkko
 
Posts: 1734
Joined: 2014-11-06 19:02

Re: power management and cpu governors :)

Postby Deb-fan » 2020-02-28 20:28

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.
Deb-fan
 
Posts: 708
Joined: 2012-08-14 12:27

Re: power management and cpu governors :)

Postby wizard10000 » 2020-02-28 20:50

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
wizard10000
 
Posts: 145
Joined: 2019-04-16 23:15
Location: southeastern us

Re: power management and cpu governors :)

Postby pylkko » 2020-02-29 07:14

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.
User avatar
pylkko
 
Posts: 1734
Joined: 2014-11-06 19:02

Re: power management and cpu governors :)

Postby Deb-fan » 2020-02-29 07:56

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. :)
Deb-fan
 
Posts: 708
Joined: 2012-08-14 12:27

Re: power management and cpu governors :)

Postby wizard10000 » 2020-02-29 10:46

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
User avatar
wizard10000
 
Posts: 145
Joined: 2019-04-16 23:15
Location: southeastern us

Re: power management and cpu governors :)

Postby Deb-fan » 2020-02-29 11:06

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
Deb-fan
 
Posts: 708
Joined: 2012-08-14 12:27

Re: power management and cpu governors :)

Postby CwF » 2020-02-29 14:03

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.
CwF
 
Posts: 654
Joined: 2018-06-20 15:16

Re: power management and cpu governors :)

Postby wizard10000 » 2020-02-29 14:42

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
User avatar
wizard10000
 
Posts: 145
Joined: 2019-04-16 23:15
Location: southeastern us

PreviousNext

Return to Offtopic

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable