Check out the new USENIX Web site. next up previous
Next: Dealing with I/O Up: Design Previous: Automatic task detector

PACE calculator

Computing the optimal speed schedule satisfying certain performance constraints requires knowledge of task CPU use distribution, which typically an application lacks. RightSpeed keeps track of how long tasks of each type have taken, and uses this information to compute such an optimal speed schedule with PACE.

In [11], we described how to compute an optimal schedule assuming a linear relationship between energy and speed squared. Since the processors on which RightSpeed runs do not satisfy this property, we developed a more general formula that does not rely on it. We discovered that the optimal speed schedule satisfies $ s^2
\mathsf{E}'(s) F^c(w) = K,$ where $ s$ is the speed to run after completing $ w$ cycles of a task, $ F^c(w)$ is the probability the task takes more than $ w$ cycles, $ \mathsf{E}(s)$ is the energy consumption at speed $ s$, and $ K$ is a constant chosen to satisfy the performance constraint. For more details about this formula and a proof that it works, see [9, pp. 83-99].

In [11], we assumed that the CPU had arbitrarily variable speed settings that could be changed at arbitrary times. Our real systems have only a limited number of speed settings, and Windows 2000 only allows us to change speed at certain fixed times, once per millisecond. Thus, for RightSpeed we need an algorithm that takes these realities into account yet still computes a near-optimal schedule. Our algorithm uses the following four steps.

  1. Create an idealized schedule using the formula above. Apply the granularization techniques of [11] to get a schedule consisting of consecutive phases, each having a constant speed.
  2. For each phase, round its speed to the closest speed that is available on the CPU and worthwhile.
  3. Round the length of each phase to an integer multiple of the scheduling granularity.
  4. As the rounding may have altered the schedule's performance characteristics, i.e., changed the pre-deadline speed, adjust the time spent at each speed by multiples of the scheduling granularity to make performance close to, but no less than, requested performance.

As an optimization, we precompute a set of parameterized speed schedules when RightSpeed is installed, based solely on the CPU characteristics. Thus, determining a speed schedule involves only a binary search through the schedules to find the lowest-energy one that nevertheless satisfies the constraint. With this optimization, the algorithm takes time $ O(n)$ where $ n$ is the number of worthwhile speed settings. For details of this and other optimizations, see [9, pp. 224-226] and the code at the website associated with this paper.


next up previous
Next: Dealing with I/O Up: Design Previous: Automatic task detector
Jay Lorch 2003-02-19