How to find default settings of the ondemand CPUFreq governor parameters in SAMSUNG S4?

6.4k views Asked by At

I would like to know the default settings of the parameters of ondemand CPUFreq governor that SAMSUNG has choosen for my SAMSUNG S4. I have not flashed my phone with any custom kernel. I have been reading about dynamic frequency scaling support in Linux Kernel and found out that CPUFreq subsystem implements this functionality with the help of the governors.

I found the governor for the Core 0 of my device as

:~$ adb shell cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

ondemand

then I started learning about ondemand governor. I found this https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt kernel documentation, which states that following are the parameters for ondemand governor.

  • sampling_rate
  • sampling_rate_min
  • up_threshold
  • ignore_nice_load
  • sampling_down_factor
  • powersave_bias

next, I was trying to figureout where/how can I acess these parameters, I read here

http://pic.dhe.ibm.com/infocenter/lnxinfo/v3r0m0/index.jsp?topic=%2Fliaai.cpufreq%2FUnderThecpufreq_base_dir.htm

and some other places as well that these parameters are found in /sys/devices/system/cpu/cpu?/cpufreq/ondemand directory.

Now, In my case for SAMSUNG S4, I can not see any directory named as ondemand inside /sys/devices/system/cpu/cpu0/cpufreq . I tried a rooted SAMSUNG S3 of a friend aswell, and I could not see the directory in that aswell.

My intention is to keep the default seetings/not change the kernel and just to get to know what are the default settings of the CPUFreq govenor I purchased the phone with ?

3

There are 3 answers

0
MrMaddTraxx On

Don't go to /sys/devices/system/cpu/cpu#/ to look for the ondemand directory.

The directory can be found here: /sys/device/system/cpu/cpufreq/ondemand (since it is not only 1 cpu you're going to command).

0
ZeDuS On

Go to "/sys/devices/system/cpu/cpu0/cpufreq" (or a different core)

Do "cat scaling_governor" to see what is the current governor Do "echo blah > something" to change things.

Enjoy :)

PS - you can also take a look at /etc/init.qcom.post_boot.sh" and look for "governor". However, if you didn't change the original state, there's no need.

0
AudioBubble On

this happens typically if you don't have really root access. what did you use looking at your friends rooted device ? did you use "adb" too ?

it works fine on my S2 with CM 10.2 . i used a ssh server and came with putty from my PC.

root@GT-I9100:/ # cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
200000
root@GT-I9100:/ # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
ondemand

but only for cpu0, not for cpu1 and i found your question very interesting.

have a nice day.