On 03/13/2007 02:59 PM, Jeremy Fitzhardinge wrote:
With your previous definition of work time, would it be that:
monotonic_time == work_time + stolen_time ??
i.e. would you be defining stolen_time to include the time lost to
processes due to the cpu running at a lower frequency? How does this
play into the other potential users, besides sched_clock(), of stolen
time? We should make sure that the abstraction introduced here makes
sense in those places too.
For example, the stuff that happens in update_process_times(). I think
we'd want to account the stolen time to cpustat->steal. Also we'd
probably want account for stolen time with regards to
task_running_tick(). (Though, in the latter case, maybe we first have
to move the scheduler away from assuming HZ rate decrementing of
p->time_slice to get this right. i.e. remove the tick based assumption
from the scheduler, and then maybe stolen time falls in more naturally
when accounting time slices).
I guess taking your cpufreq as an example of work_time progressing
slower than monotonic_time (and assuming that the remaining time is what
you would call stolen), then e.g. top would report 50% of your cpu
stolen when you cpu is running at 1/2 max rate. And p->time_slice would
decrement at 1/2 the rate it normally did when running at 1/2 speed. Is
this the right thing to do? If so, then I agree it makes sense to model
hypervisor stolen time in terms of your "work time". But, if not, then
maybe the amount of work you can get done during a period of time that
is not stolen and the stolen time itself are really two different
notions, and shouldn't be confused. I can see arguments both ways.
Dan
-