Jump to content
xisto Community
Sign in to follow this  
qwijibow

Linux: Combine Cpu Sensors With Cpu Speed Control

Recommended Posts

Hey gus and girls :Pi will first describe my setup before i ask my question...i have an AMD64 Cpu running on a 2.6.11-gentoo-r3 kernel.the cpu and kernel support features for detecting the cpu tempreture, and setting the cpu speed.the kernel has 3 different modes of controlling the cpu tempreture,Powersave (the coldest, runs the cpu at its minimum speed)Performance (the hottest, keep the cpu running at full clock speed)OnDemand (runs the cpu at higher speeds when its needed, colder when its not)UserSpace (let the user decide)At the moment, its all setup to automatically change mode in different circumstances....Performance when i run a game,OnDemand for normal desktop use,powersave for when its running in server mode, or overngiht downloading.but there is one thing i cannot figure out how to do....I want it to drop to powersave mode, IF the cpu tempreture gets too hot.the cpu tempreture is measured both by KDE's Ksensors program, And for script convinience can be read from the file "/proc/acpi/cpu/cpu0/thermal_zone/tempreture"Ksensors has a feature where is can run a user defined command upon overheat, but that is designed to run a shutdown, or play a sound, and will only execute it with user privilages.. to change the cpu clock speed, you need root access.Any idea's anyone ? (other thn running kSensors as root)

Share this post


Link to post
Share on other sites

I'm not too good with linux, but you could setup a sudo command to execute the command to change the clockspeed. So you don't need su :PI don't know how to install this command/script/i actually don't know what it is.

Share this post


Link to post
Share on other sites

Thje problem is that sudo is annoying to get working securely, and i dont like installing it just for one little task.. plus, the cpu may never ever eve overheat.so far, the best solution i can think of is to make a c++ porgram that physically writes the new govenor to the /sys filesystem, and make the compiled program suid root.I was wondering if it would be possable to make the /sys file that controls cpu frequency writable to users other than root, and if any changes to the permissions would survive a re-boot. But i dont think the kernel guys would approve of chmod 666'ing parts of the /sys filesytem lol.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.