[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: software CPU throttling on powerpc



On Sat, Jan 24, 2009 at 07:55:48PM +0100, Sven Luther wrote:
> On Sat, Jan 24, 2009 at 11:30:43AM +0100, Hans Ekbrand wrote:

[...]

> > Thanks for giving this info, but using and actually write a kernel
> > module is beyond my capabilities (and time available to get the
> > particular computing task done). 
> 
> Well, the time is a valable excuse, the lack of skill is not, since the
> functions to write are rather basic, which is why i suggested this.

I confident that your suggestions would help someone how knows C to
write such a module fast and easy. I don't know C, so I wrote a
minimal BASH script instead, not as generally useful as software
throttling in the kernel would have been, but good enough.

This script pauses (for 200 seconds) the process which take most CPU,
with exception of all ssh processes (since the NFS-mount is done over
SSH in my particular setup). I run it as cron job every 15 minutes.

PID=`ps aux | mawk '{print $3,$2,$11}' | sort -r | grep -v ssh | grep -v COMMAND | head -n 1 | mawk '{print $2}'`
kill -STOP $PID
sleep 200
kill -CONT $PID


-- 
Hans Ekbrand (http://sociologi.cjb.net) <hans@sociologi.cjb.net>

Attachment: signature.asc
Description: Digital signature


Reply to: