LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Writing kernel module to renice processes (https://www.linuxquestions.org/questions/linux-newbie-8/writing-kernel-module-to-renice-processes-947868/)

DKSL 05-31-2012 08:58 PM

Writing kernel module to renice processes
 
Hello,

I want to write a kernel module to renice process nice values of a few selected processes depending on a value from a sensor.Can this be done through a module? if so Where can I find the source of renice?

Thank you

unSpawn 06-01-2012 10:57 AM

Quote:

Originally Posted by DKSL (Post 4692457)
I want to write a kernel module to renice process nice values of a few selected processes (..). Can this be done through a module?

If you're not talking about kernel threads but regular userland processes and if this "sensor" already shows output in /proc and or /sys then I would suggest a userland daemon to read values from /proc or /sys and have the daemon re-nice userland processes.

DKSL 06-02-2012 11:48 PM

Managed to write a module to change the nice value by the process name. (Iterating through the task list,finding the process and changing the nice value). How ever this only happens once, is there a way to make the module execute at periodical intervals? Is there any timer that can be used inside the module..

It dose not show in /proc will have to poll that too(am keeping it for the next step, reading and getting data at fixed intervals. Using the above timer)


All times are GMT -5. The time now is 05:48 AM.