[ltp] Duty Cycle program

Jeffrey Taylor linux-thinkpad@linux-thinkpad.org
Sat, 22 Dec 2007 16:54:04 -0600


Quoting Henrique de Moraes Holschuh <hmh@hmh.eng.br>:
> On Thu, 20 Dec 2007, Jeffrey Taylor wrote:
> > Does anyone know of a program like nice, but sets the duty cycle (e.g. 50%
> > = 1 time slice on, one time slice off) for a program.  Long running
> > programs, 
>
> There is no such a thing for processes, but you *can* to it for the
> processor as a whole.  The ACPI "T" states do it, and work for thermal
> management (but they don't really conserve energy in the long run.  Things
> will just run cooler, and slower).
>
This is what I am looking for.
 
> You can also use governors to run the cpu slower, which is likely to work
> much better than ACPI T states.
> 
> But you might find out that running the CPU in ondemand mode, letting it go
> into C3 as often as possible ends up keeping it coller than lowering the
> maximum frequency.  If that happens, there's nothing you can do, short of
> writing something that sends the "STOP" signal and "CONT" signal to the
> processes you want to control the duty-cycle of.
> 

This is a promising lead.  I have the programming skills to write this, and
modify find to handle STOP and CONT signals if it doesn't already.  It is easy
enough to test out.  For big program builds, I could do the same thing to make
(letting a compile run full speed to completion is probably acceptable if make
runs in bursts).

Thank you,
  Jeffrey