cpufrequtils config file; where is it?

Questions about applications and software
Forum rules
Before you post please read this

cpufrequtils config file; where is it?

Postby Ubulindy on Tue Mar 04, 2014 3:05 am

Where in the heck is the config file for the cpufrequtils located? Do I just edit /ect/init.d/cpufrequtils (program) ? If so, this line only indicates 1 cpu and I have 4 with hyperthreading (line 48)So it reflects:
check_governor_avail() {
info="/sys/devices/system/cpu/cpu0/cpufreq

Do I edit that to read: info="/sys/devices/system/cpu/cpu0/cpu1/cpu2/cpu3/cpu4/cpu5/cpu6/cpu7/cpufreq So it reflects 8 cpus?
line 44 through 48:
ENABLE="true"
GOVERNOR="ondemand"
MAX_SPEED="0"
MIN_SPEED="0"

Do I set that to read:
MAX_SPEED="2400"
MIN_SPEED="800" ????

I set all this in the terminal using these commands but it didn't persist:
cpufreq-set -c 0 -g ondemand
cpufreq-set -c 1 -g ondemand
cpufreq-set -c 2 -g ondemand
cpufreq-set -c 3 -g ondemand
cpufreq-set -c 4 -g ondemand
cpufreq-set -c 5 -g ondemand
cpufreq-set -c 6 -g ondemand
cpufreq-set -c 7 -g ondemand

Oddly enough inxi reports: Clock Speeds: 1: 800.00 MHz 2: 800.00 MHz 3: 800.00 MHz 4: 800.00 MHz 5: 800.00 MHz 6: 2401.00 MHz 7: 800.00 MHz 8: 800.00 MHz
“When the government’s boot is on your throat, whether it is a left boot or a right boot is of no consequence."
User avatar
Ubulindy
Level 1
Level 1
 
Posts: 47
Joined: Sun Mar 02, 2014 6:27 pm
Location: 127.0.0.1

Linux Mint is funded by ads and donations.
 

Re: cpufrequtils config file; where is it?

Postby austin.texas on Tue Mar 04, 2014 9:58 am

I love your signature line - and here is a graphical representation of that statement.
http://en.wikipedia.org/wiki/File:Political_chart.svg

http://en.wikipedia.org/wiki/Political_spectrum#Other_proposed_dimensions
Mint 17 v2 Cinnamon (64 bit), Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Microsoft-free environment since 1996

To help Linux Mint with a donation, please visit http://www.linuxmint.com/donors.php
User avatar
austin.texas
Level 10
Level 10
 
Posts: 3309
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: cpufrequtils config file; where is it?

Postby oscarus on Fri May 02, 2014 9:17 pm

I have been trying to figure this one out for a few hours now.
I used the following commands to lower the maximum frequency from 1.73Ghz to 1.6Ghz because my laptop was getting too hot even if I changed the freq scaling governors.
Code: Select all
sudo sh -c 'cpufreq-set -c 0 -u 1.60GHz; cpufreq-set -c 1 -u 1.60GHz; cpufreq-set -c 2 -u 1.60GHz; cpufreq-set -c 3 -u 1.60GHz; cpufreq-set -c 4 -u 1.60GHz; cpufreq-set -c 5 -u 1.60GHz; cpufreq-set -c 6 -u 1.60GHz; cpufreq-set -c 7 -u 1.60GHz'


According to cpufreq-info (and my now quieter fan), the commands worked. I was so happy... until I suspended the machine. Upon resuming, I checked cpufreq-info again only to find that the maximum frequency was reset and back to 1.73ghz.

I changed this on the cpufrequtils file
ENABLE="true"
GOVERNOR="ondemand"
MAX_SPEED="1466000"
MIN_SPEED="933000"

But it only worked on cpu0 (cpu1 through cpu7 are set at 1.73ghz). The maximum frequency on cpu0 persists even after suspending, so I guess I'm on the right path to fixing the thing, but just as OP, I can't figure out how to make the settings permanent accross all cpu's.

I guess I don't have much of an answer, but I just wanted to check with OP to see if he's found something new about this. This is the only instance I've found so far of a description of the same problem I have. If anyone else has some answers, I'd really appreciate any help.
User avatar
oscarus
Level 1
Level 1
 
Posts: 20
Joined: Sat Dec 01, 2012 6:43 pm

Re: cpufrequtils config file; where is it?

Postby Ubulindy on Fri May 02, 2014 9:31 pm

oscarus wrote:I have been trying to figure this one out for a few hours now.
I used the following commands to lower the maximum frequency from 1.73Ghz to 1.6Ghz because my laptop was getting too hot even if I changed the freq scaling governors.
Code: Select all
sudo sh -c 'cpufreq-set -c 0 -u 1.60GHz; cpufreq-set -c 1 -u 1.60GHz; cpufreq-set -c 2 -u 1.60GHz; cpufreq-set -c 3 -u 1.60GHz; cpufreq-set -c 4 -u 1.60GHz; cpufreq-set -c 5 -u 1.60GHz; cpufreq-set -c 6 -u 1.60GHz; cpufreq-set -c 7 -u 1.60GHz'


According to cpufreq-info (and my now quieter fan), the commands worked. I was so happy... until I suspended the machine. Upon resuming, I checked cpufreq-info again only to find that the maximum frequency was reset and back to 1.73ghz.

I changed this on the cpufrequtils file
ENABLE="true"
GOVERNOR="ondemand"
MAX_SPEED="1466000"
MIN_SPEED="933000"

But it only worked on cpu0 (cpu1 through cpu7 are set at 1.73ghz). The maximum frequency on cpu0 persists even after suspending, so I guess I'm on the right path to fixing the thing, but just as OP, I can't figure out how to make the settings permanent accross all cpu's.

I guess I don't have much of an answer, but I just wanted to check with OP to see if he's found something new about this. This is the only instance I've found so far of a description of the same problem I have. If anyone else has some answers, I'd really appreciate any help.


Hi,
My settings have persisted, but only one of the CPUs ever changes, CPU6. Mine stays on power saving mode of 800 MHz. Try the settings I left alone, and see if it works:
ENABLE="true"
GOVERNOR="ondemand"
MAX_SPEED="0"
MIN_SPEED="0"

Also I achieved this via command line and not editing the config file directly. Maybe it will work for you as well.
Also, OP is a female, not a male :)
“When the government’s boot is on your throat, whether it is a left boot or a right boot is of no consequence."
User avatar
Ubulindy
Level 1
Level 1
 
Posts: 47
Joined: Sun Mar 02, 2014 6:27 pm
Location: 127.0.0.1

Re: cpufrequtils config file; where is it?

Postby oscarus on Fri May 02, 2014 9:51 pm

Ubulindy wrote:Hi,
My settings have persisted, but only one of the CPUs ever changes, CPU6. Mine stays on power saving mode of 800 MHz. Try the settings I left alone, and see if it works:
ENABLE="true"
GOVERNOR="ondemand"
MAX_SPEED="0"
MIN_SPEED="0"

Also I achieved this via command line and not editing the config file directly. Maybe it will work for you as well.
Also, OP is a female, not a male :)

Oops! sorry about that!

So, what exactly did you end up doing? Was the governor the only thing you wanted to change? I think "ondemand" was already my default, but the thing I want to change (which led to me editing that script) is the max freq to kinda recreate the setting windows has where you can set the maximum processing power the system can use. I thought I had the answer with the commands I listed, but their lack of persistence has now become the bane of my existence! I want to keep looking, but all my links on google are already purple haha!
User avatar
oscarus
Level 1
Level 1
 
Posts: 20
Joined: Sat Dec 01, 2012 6:43 pm

Re: cpufrequtils config file; where is it?

Postby Ubulindy on Fri May 02, 2014 9:56 pm

Sec, Im trying to find a really old forum link I had used. I had also disabled powersave settings via cli. Maybe that's what finally made the settings persist? Trying to find the link. Sorry, Ive looked and looked and I cant find that old forum thread. It was an old Ubuntu forum, think was ubuntu 8.04 or something like that. But I followed what it said and it worked. Damnit wish I could find the link... sorry. I did however just find this:
For more information about governors, read cpu-drivers.txt (available in /usr/share/doc/linux-doc-2.6.32/Documentation/cpu-freq/ from the package linux-doc-2.6, you can read the latest version from kernel.org).

GOVERNOR variable from /etc/default/cpufrequtils not taking effect:
So, you configured the GOVERNOR variable in /etc/default/cpufrequtils and after reboot you notice by running cpufreq-info that the active governor is still "ondemand".

This may happen if you have laptop-mode-tools installed. laptop-mode configures the active governor via the following variables: BATT_CPU_GOVERNOR, LM_AC_CPU_GOVERNOR, NOLM_AC_CPU_GOVERNOR. You can override them to your liking in /etc/laptop-mode/laptop-mode.conf:


BATT_CPU_GOVERNOR=powersave
LM_AC_CPU_GOVERNOR=conservative
NOLM_AC_CPU_GOVERNOR=ondemand
If you use laptop-mode to set the governor, you can disable /etc/init.d/cpufrequtils from starting at boot to save a few miliseconds:


update-rc.d -f cpufrequtils remove


https://wiki.debian.org/HowTo/CpuFrequencyScaling
“When the government’s boot is on your throat, whether it is a left boot or a right boot is of no consequence."
User avatar
Ubulindy
Level 1
Level 1
 
Posts: 47
Joined: Sun Mar 02, 2014 6:27 pm
Location: 127.0.0.1

Re: cpufrequtils config file; where is it?

Postby kurotsugi on Fri May 02, 2014 11:15 pm

instead of using cpufrequtils using tlp might easier.
kurotsugi
Level 5
Level 5
 
Posts: 917
Joined: Fri Jan 25, 2013 3:54 am

Re: cpufrequtils config file; where is it?

Postby Ubulindy on Fri May 02, 2014 11:21 pm

kurotsugi, it would be nice to know what tlp is???
“When the government’s boot is on your throat, whether it is a left boot or a right boot is of no consequence."
User avatar
Ubulindy
Level 1
Level 1
 
Posts: 47
Joined: Sun Mar 02, 2014 6:27 pm
Location: 127.0.0.1

Re: cpufrequtils config file; where is it?

Postby kurotsugi on Fri May 02, 2014 11:50 pm

ah. sorry. it's quite new tool and not in the official repo yet. it's a tool for power saving. one of the feature is control both cpu govs and cpu freq :3
Code: Select all
deb http://ppa.launchpad.net/linrunner/tlp/ubuntu lucid main

if you only want to control the cpu freq you only need tlp but you can also install tlp rdw to control radio connection.
http://linrunner.de/en/tlp/tlp.html
kurotsugi
Level 5
Level 5
 
Posts: 917
Joined: Fri Jan 25, 2013 3:54 am

Re: cpufrequtils config file; where is it?

Postby oscarus on Sat May 03, 2014 2:57 am

TLP works perfectly (even after rebooting or suspending!) Thank you guys (the royal "guys" :P ) for all your help!


You know, the weird thing is that I had installed TLP earlier today, but as soon as I saw that it required to remove the default ondemand governor to avoid conflicts, I thought it would be too hacky or complicated. After all the nonsense I tried and thanks to your recommendation, I gave TLP another chance only to realize it is actually very simple to use.

For future reference, here is what I edited on the TLP configuration file (don't forget to uncomment the settings you want to edit! i.e. remove the # ):
Code: Select all
CPU_SCALING_GOVERNOR_ON_AC=ondemand
CPU_SCALING_GOVERNOR_ON_BAT=ondemand

CPU_SCALING_MIN_FREQ_ON_AC=0
CPU_SCALING_MAX_FREQ_ON_AC=1466000
CPU_SCALING_MIN_FREQ_ON_BAT=0
CPU_SCALING_MAX_FREQ_ON_BAT=1466000


Changing those settings makes "ondemand" the scaling governor and sets the max frequency of all the cores (cpu0 through cpu7) to 1.47 Ghz, which is 85% of the default 1.73 Ghz. This keeps the laptop from doubling as a space heater and marshmallow roaster, but those are "features" I can happily live without.

I also reverted the cpufrequtils file to its default settings just in case.
User avatar
oscarus
Level 1
Level 1
 
Posts: 20
Joined: Sat Dec 01, 2012 6:43 pm

Re: cpufrequtils config file; where is it?

Postby kurotsugi on Sat May 03, 2014 7:07 am

just a little note:
tlp can't work well with laptop-mode-tools and cpufrequtils. if we're on ubuntu based OS we might need to stop ondemand service (/etc/init.d/ondemand). the cpu gov control also didn't work well on some intel cpu if you're using p-state driver. p-state only have powersave and performance gov. thus, using ondemand on tlp config file won't work.
kurotsugi
Level 5
Level 5
 
Posts: 917
Joined: Fri Jan 25, 2013 3:54 am

Re: cpufrequtils config file; where is it?

Postby oscarus on Sat May 03, 2014 7:24 am

kurotsugi wrote:just a little note:
tlp can't work well with laptop-mode-tools and cpufrequtils. if we're on ubuntu based OS we might need to stop ondemand service (/etc/init.d/ondemand). the cpu gov control also didn't work well on some intel cpu if you're using p-state driver. p-state only have powersave and performance gov. thus, using ondemand on tlp config file won't work.


They offer a solution for the ondemand conflict here: http://linrunner.de/en/tlp/docs/tlp-faq.html#scaling
User avatar
oscarus
Level 1
Level 1
 
Posts: 20
Joined: Sat Dec 01, 2012 6:43 pm

Re: cpufrequtils config file; where is it?

Postby Flemur on Sat May 03, 2014 10:40 am

I love your signature line - and here is a graphical representation of that statement.


Here's a better one!
http://2.bp.blogspot.com/-iaKgQja7IkI/T ... us_big.jpg
Mint 17/Xfce/fluxbox & another Mint 17/Xfce/fluxbox
User avatar
Flemur
Level 5
Level 5
 
Posts: 908
Joined: Mon Aug 20, 2012 9:41 pm

Re: cpufrequtils config file; where is it?

Postby Ubulindy on Sat May 03, 2014 11:14 am

kurotsugi wrote:ah. sorry. it's quite new tool and not in the official repo yet. it's a tool for power saving. one of the feature is control both cpu govs and cpu freq :3
Code: Select all
deb http://ppa.launchpad.net/linrunner/tlp/ubuntu lucid main

if you only want to control the cpu freq you only need tlp but you can also install tlp rdw to control radio connection.
http://linrunner.de/en/tlp/tlp.html



I'm on LMDE. Didn't I read that we aren't to add PPA's from Ubuntu to LMDE because they are not compatible and can/might/will break your system? That LMDE and Ubuntu are NOT interchangeable. Thanks for the info but because of this I think I'll pass :P
“When the government’s boot is on your throat, whether it is a left boot or a right boot is of no consequence."
User avatar
Ubulindy
Level 1
Level 1
 
Posts: 47
Joined: Sun Mar 02, 2014 6:27 pm
Location: 127.0.0.1

Re: cpufrequtils config file; where is it?

Postby kurotsugi on Sun May 04, 2014 1:22 am

that's the general rule for PPA but that PPA is an exception since the lucid branch contain *deb files build for debian testing. the one who maintaining that PPA is the tlp dev himself. http://linrunner.de/en/tlp/docs/tlp-lin ... ement.html
Debian 6.0 and higher
as well as Linux Mint Debian Edition (LMDE)

Execute the following steps in a root shell.

Add a line for the package repository TLP-PPA to your /etc/apt/sources.list:
Code: Select all
deb http://ppa.launchpad.net/linrunner/tlp/ubuntu lucid main


Add the public key for the PPA:
Code: Select all
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 02D65EFF


If the above command fails, try with a different keyserver:
Code: Select all
apt-key adv --keyserver pool.sks-keyservers.net --recv-keys 02D65EFF


Update package data:
Code: Select all
apt-get update


Install the following packages:
Code: Select all
    tlp (PPA) – Power saving
    tlp-rdw (PPA) – optional, Radio Device Wizard
    tp-smapi-dkms (main) – optional ThinkPad only, tp-smapi is needed for battery charge thresholds and ThinkPad specific status output of tlp-stat
    acpi-call-tools (PPA) – optional ThinkPad only, acpi-call is needed for battery charge thresholds on Sandy Bridge and newer models (X220/T420, X230/T430 et al.)

The above packages may be installed via package management tools or terminal command:
Code: Select all
sudo apt-get install tlp tlp-rdw


ThinkPads require an additional:
Code: Select all
sudo apt-get install tp-smapi-dkms acpi-call-tools
kurotsugi
Level 5
Level 5
 
Posts: 917
Joined: Fri Jan 25, 2013 3:54 am

Re: cpufrequtils config file; where is it?

Postby Ubulindy on Sun May 04, 2014 10:34 am

Ahhh, thanks for the info kurotsugi! I'll take a look at it more once I wake up a bit, need my coffee right now :D
“When the government’s boot is on your throat, whether it is a left boot or a right boot is of no consequence."
User avatar
Ubulindy
Level 1
Level 1
 
Posts: 47
Joined: Sun Mar 02, 2014 6:27 pm
Location: 127.0.0.1

Linux Mint is funded by ads and donations.
 

Return to Software & Applications

Who is online

Users browsing this forum: No registered users and 5 guests