LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-31-2012, 07:58 PM   #1
DKSL
LQ Newbie
 
Registered: Apr 2012
Posts: 29

Rep: Reputation: Disabled
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
 
Old 06-01-2012, 09:57 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by DKSL View Post
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.
 
Old 06-02-2012, 10:48 PM   #3
DKSL
LQ Newbie
 
Registered: Apr 2012
Posts: 29

Original Poster
Rep: Reputation: Disabled
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)
 
  


Reply

Tags
modules, priority



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] writing a trivial kernel module - help kaching Programming 4 06-08-2010 07:12 AM
linux kernel module re-writing bony Programming 1 03-20-2010 11:10 AM
Renice without affecting inherited child processes? garr0n Linux - Software 1 10-09-2007 01:03 PM
Kernel Module Writing itz2000 Programming 6 10-05-2007 03:54 PM
need help in writing Makefile for module in 2.6 kernel videsh Programming 1 01-19-2006 07:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration