# Conservative Governor Settings?

## Antimatter

I'm not sure what each of these settings are /sys/devices/system/cpu/cpu0/cpufreq/conservative in this directory.

Anyway I've been searching around the web on google for information on the conservative governor and haven't found anything, then searched on the forums, didn't find much that was related to the subject that i was looking for.

Hell i even went in and dig around in the source code to see if i could find any form of clear explanation of what each of these values/variables are in that directory.

Reason why I'm asking is because i want to see what settings i can tweak to make it perform a bit better than it is currently.

Anyone got any list of what variable does what in that folder?

Thanks!

----------

## Antimatter

No one has any idea, or is it RTFM somewhere that I haven't located yet?

----------

## maverick256

would you give the file names of those settings? The conservative governor is related to the ondemand governor, and perhaps the setting parameters are similar, or even the same.

----------

## Antimatter

 *maverick256 wrote:*   

> would you give the file names of those settings? The conservative governor is related to the ondemand governor, and perhaps the setting parameters are similar, or even the same.

 

down_threshold  

ignore_nice           

sampling_rate     

sampling_rate_min

freq_step       

sampling_down_factor  

sampling_rate_max  

up_threshold

These above are the filename for the settings.

----------

## bollucks

 *Antimatter wrote:*   

>  *maverick256 wrote:*   would you give the file names of those settings? The conservative governor is related to the ondemand governor, and perhaps the setting parameters are similar, or even the same. 
> 
> down_threshold  
> 
> ignore_nice           
> ...

 

down_threshold - cpu% to drop speed

ignore_nice - dont consider 'nice' tasks when deciding when to change cpu (default is to not speed up when niced tasks use cpu)

sampling_rate - interval between checking cpu usage (higher is less frequent checking)

freq_step - size of frequency steps

sampling_rate_* - obvious

sampling_down_factor - no idea

up_threshold - cpu% to increase speed

----------

## Antimatter

 *bollucks wrote:*   

>  *Antimatter wrote:*    *maverick256 wrote:*   would you give the file names of those settings? The conservative governor is related to the ondemand governor, and perhaps the setting parameters are similar, or even the same. 
> 
> down_threshold  
> 
> ignore_nice           
> ...

 

Thank you, for most part those are pretty obvious, but the thing that I'm still struggling with is the "units" I'll make an educated guess and post it below.

Percentage - down_threshold, up_threshold (again obvious for most part)

Frequency(kHz?) - freq_step  (Say my laptop only supports 200 MHz steps i would stick in something alikin to 204800 into that file?)

int/bool - ignore_nice (again pretty obvious for most part)

The samping_rate* are the one that I'm not sure, is it in microseconds, or what?

----------

## s0be

 *Quote:*   

> FROM:drivers/cpufreq/cpufreq_conservative.c
> 
>         /*
> 
>          * The default safe range is 20% to 80%
> ...

 

down_threshold:

This is the percent as an integer that, if there is (that little load) or (100-that much idle), it'll drop the cpu frequency.

up_threshold:

This is the percent as an integer that, if ther is (that much load) or (100-that little idle),it'll up the cpu frequency.

sampling_rate_min:

NON tunable.  This is the minimum you can set the sampling rate to.

sampling_rate_max:

NON tunable.  This is the maximum you can set the sampling rate to.

sampling_rate:

A value between sampling_rate_min and sampling_rate_max.  This is in Micro Seconds (uS)

ignore_nice:

This dictates how we calculate our cpu idleness...

Take this example:

Cpu(s):  4% user,  16% sys,  10% ncei, 70% idle

ignore_nice=0 => Idle = 70%

ignore_nice=1 => Idle = 80%

freq_step:

mhz step of the steps taken(will cover this all in a sec.)

sampling_down_factor:

ok, if we have sampling_rate set to 1000, and sampling_down_factor set to 5, we check ever 1000 uS for upstepping the cpu, but every 5 * 1000 uS for when to down step the cpu.

Bringing this all together:

Every sampling_rate, we check the idle percent.  If (100 - Idle Percent) > up_threshold, we increase the cpufrequency by freq_step.  Every sampling_down_factor * sampling rate, we check the idle percent again.  If (100 - Idle Percent) < down_threshold, we decrese the cpu frequency by freq_step.  Every time we change cpu frequency, we check to see if we've reached the next cutoff of the cpu(so for a 200 mhz step between speeds on a cpu, and freq_step of 5, it'd take 40 steps to alter the cpu speed).  idle percent is either plane idle percent (ignore_nice = 1) or idle percent + nice percent (ignore_nice = 0).

Hope that's a good description.

(I had to figure this out to tune it for my cpu.  I found down threshold=30, up threshole=80, freq_step=20 to be good for my p4 530 and my load.  ymmv)

[edit, fixed math]

----------

## Antimatter

s0be: Awesome thanks!  :Smile:  It's good to have some confirmation from another person to confirm some of the thing I was thinking for those files, I'm writing a sort of installation manual for a thinkpad so i was just trying to get confirmation and figure out these files.  Thanks!

----------

## s0be

Well, feel free to include any/all of that information in the guide.

----------

## Antimatter

 *s0be wrote:*   

> Well, feel free to include any/all of that information in the guide.

 

Thanks, will do so.  I already have a biblography entery so its easy to add any new source into the guide and cite them correctly.

Thanks again!  :Smile: 

----------

