[Plugin] CoreFreq


Recommended Posts

On 6/6/2021 at 9:53 AM, Vr2Io said:

Call trace happen during install and reboot, try several BIOS setting can't fix. Sometime will be hang in dead.

 

Since then ( 2 years ago ) I haven't try / use this plugin.

 

Today, I use it to troubleshoot a server which apply PL2, but system actually just ignore the setting and use lot of power. After many booting and BIOS setting, I finally identify "Disable SVID" cause this problem, set it to auto then solve. The problem haven't aware in long time after BIOS have update several times.

 

https://linustechtips.com/topic/888024-what-is-asus-svid-support-and-when-should-i-use-it/?do=findComment&comment=10957949

 

I also install in two other machine and all work great, with this wonderful tool, now I got much better knowing the power usage in Unraid environment. 

 

I also make some test to compare the reading from power meter, in my view the reading should be consistence.

 

@ich777 @CyrIng Thanks !!

 

1. Idling, meter 30w, Pkg 4.6w, different ~25w

 

image.png.dce432953d3a82806bb4876e7b7bbd8c.png

 

2. Atomic Burn, different ~ 39w

 

image.png.4478596087457f57de197ff769966ba1.png

 

3. Conic Compute, different ~ 44w

 

image.png.bceaaa04041d394088f42c568ccaaa37.png

 

 

4. Turbo Random CPU, different ~ 30w

 

 image.png.200c206e0be2558edf59af6c18245dda.png

 

5. Estimate PI / Monte Carlo, different ~ 41w

 

image.png.5e961b7eaeedd334a981a356b6c1120d.png

Edited by Vr2Io
  • Like 1
Link to comment
  • 1 month later...
4 hours ago, sunwind said:

any way to save the boost config setting on restarts?

What settings did you change? I think there are options for the syslinux.conf so that you can make these changes persistent.

 

@CyrIng can you maybe help here? What do you think about the idea if I add a help page for the config parameters so that users can easily append them to the syslinux.conf or the modprobe.d file?

Link to comment
On 8/8/2023 at 8:05 AM, sunwind said:

Thanks.!

Please update the plugin and visit the plugin page, you will then see a new tab where it is described what to do to make the changes persistent (the first example on this page is exactly what you need or better speaking what you've changed).

  • Thanks 2
Link to comment

@ich777

 

Setting turbo on all my cores manually and using the persist file with;

options corefreqk TurboBoost_Enable=1
 

The cores aren't boosted on restart. Do I need a switch to enable each one? because that's how I turn it on manually, there's an option for each core / or thread.

 

I've noticed after I turn it on, even if I turn it off manually each core seems to stay at max boost, or at least it never drops as low as it did on a clean boot.

 

image.thumb.png.d29e31f0263e00fa4a2d52c088f08d13.png

 

 

Edit: I just noticed enabling turbo, my freq doesn't go as high as it used to:

image.thumb.png.2d02c409bb2c344dcb11e67ace00a88d.png

Edited by sunwind
Link to comment
18 hours ago, sunwind said:

Edit: I just noticed enabling turbo, my freq doesn't go as high as it used to:

Right after starting up with parameter `TurboBoost_Enable=1` please show me how are programmed the boosted frequency ratios in the UI window called Processor ? 

(those are `1C`, `2C` and so on) 

  • Like 1
Link to comment

>options corefreqk TurboBoost_Enable=1

 

This is after I boot up;

image.thumb.png.527ddd4d290f39f0a231270ec352582d.png

 

image.png.c8dd783706592895695c6e6e18bb9072.png image.png.41931aa7a4a78425c0194b1b9ed42f06.png

 

Wasn't sure what you needed to see.

 

After a couple mins (probably dockers starting):

image.thumb.png.c2c639ea16c286bf1adf0e88d48d9885.png

 

But still isn't running max turbo all the time.

Again though, is that fine to do as long as I can keep the temps from going too high? would it possibly negatively affect performance?

Link to comment
3 hours ago, sunwind said:

Wasn't sure what you needed to see.

Press key p to open the "Processor" window and scroll down to bottom. 

 

You can also export the same using option:

corefreq-cli -s

Then post the output as code in reply. 

 

Turbo boost is a multifactorial feature:

* IDA available

* Speed Step Enable 

* C-States activated

* Idle loop using mwait or I/O-wait operating by kernel

* Boosted frequencies well programmed in descending orders from single to all (ie 8 simultaneous) core(s) 

* Target Frequency P-state equal BCLK (Max Ratio) plus at least one bin

+ TDP > Turbo Activation : preferably set to Auto (aka value zero) 

* No other limitation such as ODCM or Energy Policy Bias Hint or misc PL (Power Limiters) 

 

A competitive feature is HWP which follows rules of desired Frequency requests.

HWP has a programmable Target and Max ratios you'll set in the Processor window.

An Energy EPP scaler in window shortkey `o`

 

Remarks:

* Prerequisite is to activate HWP.

Press `z` key to enable or check its current state

* HWP can only be disabled by reboot. 

* BIOS is also managing HWP

* Kernel is also attempting to activate HWP

 

You have to check by which Engine is governed your CPU.

HWP or Turbo Boost ? 

 

FYI the closest CFL Xeon I had logged is this E-2246G

Edited by CyrIng
Example Coffee Lake
  • Like 1
Link to comment
37 minutes ago, Nuke said:

Not applied. All ratio still 43 after reboot.

Am I do wrong?

Please add parameter Experimental=1

 

Then verify the obtained frequency 

 

If still ko, can you try manually from a terminal 

 

First unload any running instance of CoreFreq:

1. corefreq-cli 

2. corefreqd 

3. driver with `rmmod corefreqk`

 

Next start directly CoreFreq with the parameter:

1. Change to directory of the driver

1. insmod corefreqk.ko PState_FID=37 

2. corefreqd 

3. corefreq-cli 

 

Check the resulting frequency 

 

  • Like 1
Link to comment
13 hours ago, CyrIng said:

Please add parameter Experimental=1

 

Then verify the obtained frequency 

Nope.

 

13 hours ago, CyrIng said:

Next start directly CoreFreq with the parameter:

1. Change to directory of the driver

1. insmod corefreqk.ko PState_FID=37 

2. corefreqd 

3. corefreq-cli 

 

Check the resulting frequency 

I can't find properly directory. I see only *.ko.xz file

 

image.png.91eecbea4c0bfe6d1d1be9b781df5f00.png

Link to comment
1 hour ago, Nuke said:

I can't find properly directory. I see only *.ko.xz file

I don't understand what you mean with that or why you search for the corefreqk kernel module anyways...

 

The module is in /lib/modules/5.19.17-Unraid/extra/ and therefore it is named corefreqk.ko.xz

You won't be able to modprobe a module that is not installed anyways but in your case it's installed, the .xz extension means only that it is packed with xz to save additional space and won't affect how the module is working.

 

This should do the trick for you:

kill $(pidof corefreqd)
modprobe -r corefreqk
modprobe corefreqk Experimental=1 PState_FID=37
corefreqd &
corefreq-cli

(you can skip the first and the second last line if you disable CoreFreq on the plugin page and re-enabling it after you did the modprobe lines)

 

1 hour ago, Nuke said:

Nope.

Please describe the steps that you've done exactly.

Link to comment
11 minutes ago, ich777 said:

I don't understand what you mean with that

 

@Nuke

I'm trying to verify if parameters are effectively submitted to driver. 

 

`insmod` is distribution independent.

 

Immediately after inserting module, check kernel log (`dmesg`) for parameter reject or not ? 

Edited by CyrIng
  • Like 1
Link to comment
1 minute ago, CyrIng said:

I'm trying to verify if parameters are effectively submitted to driver. 

I think the main reason why it failed is because corefreqd was still running.

 

The user also doesn't said much about what was not working and also what he did in the first place step by step. I assume that maybe `rmmod corefreqk` failed because corefreqd was still running and therefore the insmod wouldn't do much.

 

This line:

11 minutes ago, CyrIng said:
insmod /lib/modules /5.19.17-Unraid/extra/corefreqk.ko PState_FID=37

should also be:

insmod /lib/modules/5.19.17-Unraid/extra/corefreqk.ko.xz PState_FID=37

(there was a space after modules and the extension .xz was missing)

Link to comment

@Nuke

I believe from the UI you have disabled Turbo Boost prior altering the Max Frequency. 

You may also have register CoreFreq as CPU-Freq handler. 

In fact you have to do the same with parameters. Disabling Turbo Boost is a prerequisite because the max FID affects the P0 pstate. I thus have to calibrate kernel clock against TSC right after FID changed. 

 

Sorry for that late precision, I'm far from office for a while with smartphone only. 

 

Free free to ask. 

 

 

Btw, Pstate FID is reserved to AMD architectures only. 

  • Like 1
  • Thanks 1
Link to comment
59 minutes ago, ich777 said:

This should do the trick for you:

kill $(pidof corefreqd)
modprobe -r corefreqk
modprobe corefreq Experimental=1 PState_FID=37
corefreqd &
corefreq-cli

 

 

44 minutes ago, ich777 said:
insmod /lib/modules/5.19.17-Unraid/extra/corefreqk.ko.xz PState_FID=37

 

 

No processes coref*

image.png.d77e46b115686e6aab33fb15d51e8f99.png

 

image.png.22b6ae11d4521039860d5a6250456fb5.png

Edited by Nuke
  • Thanks 1
Link to comment
On 8/12/2023 at 5:22 PM, Nuke said:

I need a little slow-down my CPU for hold temperature under 70C instead of >85C, so i change max ratio from 43 to 37.
How can i make it persistent?
I see the new module options section but I don't see the required line.

image.png

static signed int Ratio_HWP[1 + (BOOST(HWP_TGT) - BOOST(HWP_MIN))] = {
	/*	HWP_MIN 	*/	-1,
	/*	HWP_MAX 	*/	-1,
	/*	HWP_TGT 	*/	-1
};

So the right parameter you need is:

Ratio_HWP=-1,37,-1

 

  • Like 1
  • Thanks 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.