Re: Stolen and degraded time and schedulers

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jeremy Fitzhardinge
Date: Wednesday, March 14, 2007 - 12:34 pm

Dan Hecht wrote:

OK.  I had used "monotonic" in its more general sense earlier in the
thread, and I wanted to be sure.


Sure.  But on a given machine, the CPUs are likely to be closely enough
matched that a cycle on one CPU is more or less equivalent to a cycle on
another CPU.  The fact that a cycle represents a different amount of
work on an i486 compared to Core2 doesn't matter much.  The important
part is that when the scheduler is doling out CPU time is comparing
everyone's usages with a common unit.

Yes, but the question is whether it matters all that much?  Does it
matter enough to make them two separate concepts, when one seems to
cover all the important points?


Not at all.  You might have an unimportant but cpu-bound process which
doesn't merit increasing the cpu speed, but should also be scheduled
properly compared to other processes.  I often nice my kernel builds
(which cpufreq takes as a hint to not ramp up the cpu speed) on my
laptop so to save power.


It doesn't matter.  The scheduler is only important when there's
contention for the cpu, and if there is, that it compare process CPU
usage with the same unit.  What that unit isn't inherently very
important, so long as its consistent.


That's true.  But this is a case of the left brain not talking to the
right brain: cpufreq might decide to slow a cpu down, but the scheduler
doesn't take that into account.  Making the timebase of sched_clock
reflect the current cpu speed (or more specifically, the integral of the
cpu speed over a time interval) is a good way of communicating between
the two subsystems.


As things stand now, there's not much difference from the scheduler's
perspective, since the scheduler takes no action in either case.


So, this is the target process timeslice, in units of sched_clock's
timebase?


I added stolen time accounting to xen-pv_ops last night.  For Xen, at
least, it wasn't hard to fit into the clockevent infrastructure.  I just
update the stolen time accounting for each cpu when it gets a timer
tick; they seem to get a tick every couple of seconds even when idle.

Similarly, implementing sched_clock as "number of ns the vcpu spent in
running state" is simple and direct (though this makes it an explicitly
per-cpu clock; comparing raw sched_clock values between cpus will be
meaningless; but that's likely true when using the tsc as a timebase too).


It doesn't matter why you didn't get the time; the important part is
that you know that time went missing.  Its true that you may end up with
some spurious rescheds, but that seems like the kind of thing you'd want
to measure as being a problem before getting clever in fixing.


I'd call that an oversight.  Xen has everything needed to implement
sched_clock in terms of non-stolen time.


Not necessarily.  The cpu might drop into thermal protection clock
modulation.

    J
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Tue Mar 13, 9:31 am)
Re: Stolen and degraded time and schedulers, john stultz, (Tue Mar 13, 1:12 pm)
Re: Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Tue Mar 13, 1:32 pm)
Re: Stolen and degraded time and schedulers, Daniel Walker, (Tue Mar 13, 2:27 pm)
Re: Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Tue Mar 13, 2:59 pm)
Re: Stolen and degraded time and schedulers, Dan Hecht, (Tue Mar 13, 5:43 pm)
Re: Stolen and degraded time and schedulers, Daniel Walker, (Tue Mar 13, 7:00 pm)
Re: Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Tue Mar 13, 9:37 pm)
Re: Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Tue Mar 13, 11:52 pm)
Re: Stolen and degraded time and schedulers, Zan Lynx, (Wed Mar 14, 1:20 am)
Re: Stolen and degraded time and schedulers, Lennart Sorensen, (Wed Mar 14, 6:58 am)
Re: Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Wed Mar 14, 8:08 am)
Re: Stolen and degraded time and schedulers, Lennart Sorensen, (Wed Mar 14, 8:12 am)
Re: Stolen and degraded time and schedulers, Daniel Walker, (Wed Mar 14, 9:11 am)
Re: Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Wed Mar 14, 9:37 am)
Re: Stolen and degraded time and schedulers, Daniel Walker, (Wed Mar 14, 9:59 am)
Re: Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Wed Mar 14, 10:08 am)
Re: Stolen and degraded time and schedulers, Daniel Walker, (Wed Mar 14, 11:06 am)
Re: Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Wed Mar 14, 11:41 am)
Re: Stolen and degraded time and schedulers, Daniel Walker, (Wed Mar 14, 12:00 pm)
Re: Stolen and degraded time and schedulers, Dan Hecht, (Wed Mar 14, 12:02 pm)
Re: Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Wed Mar 14, 12:34 pm)
Re: Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Wed Mar 14, 12:44 pm)
Re: Stolen and degraded time and schedulers, Rik van Riel, (Wed Mar 14, 12:45 pm)
Re: Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Wed Mar 14, 12:47 pm)
Re: Stolen and degraded time and schedulers, Rik van Riel, (Wed Mar 14, 1:02 pm)
Re: Stolen and degraded time and schedulers, Dan Hecht, (Wed Mar 14, 1:26 pm)
Re: Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Wed Mar 14, 1:31 pm)
Re: Stolen and degraded time and schedulers, Daniel Walker, (Wed Mar 14, 1:33 pm)
Re: Stolen and degraded time and schedulers, Ingo Molnar, (Wed Mar 14, 1:38 pm)
Re: Stolen and degraded time and schedulers, Dan Hecht, (Wed Mar 14, 1:46 pm)
Re: Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Wed Mar 14, 1:59 pm)
Re: Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Wed Mar 14, 2:16 pm)
Re: Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Wed Mar 14, 2:18 pm)
Re: Stolen and degraded time and schedulers, Daniel Walker, (Wed Mar 14, 2:34 pm)
Re: Stolen and degraded time and schedulers, Con Kolivas, (Wed Mar 14, 2:36 pm)
Re: Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Wed Mar 14, 2:38 pm)
Re: Stolen and degraded time and schedulers, Con Kolivas, (Wed Mar 14, 2:40 pm)
Re: Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Wed Mar 14, 2:42 pm)
Re: Stolen and degraded time and schedulers, Paul Mackerras, (Wed Mar 14, 10:23 pm)
Re: Stolen and degraded time and schedulers, Dan Hecht, (Thu Mar 15, 12:09 pm)
Re: Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Thu Mar 15, 12:18 pm)
Re: Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Thu Mar 15, 12:33 pm)
Re: Stolen and degraded time and schedulers, Rik van Riel, (Thu Mar 15, 12:48 pm)
Re: Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Thu Mar 15, 12:53 pm)
Re: Stolen and degraded time and schedulers, Dan Hecht, (Thu Mar 15, 1:07 pm)
Re: Stolen and degraded time and schedulers, Rik van Riel, (Thu Mar 15, 1:14 pm)
Re: Stolen and degraded time and schedulers, Dan Hecht, (Thu Mar 15, 1:35 pm)
Re: Stolen and degraded time and schedulers, Ingo Molnar, (Fri Mar 16, 1:38 am)
Re: Stolen and degraded time and schedulers, Martin Schwidefsky, (Fri Mar 16, 1:59 am)
Re: Stolen and degraded time and schedulers, Jeremy Fitzhardinge, (Fri Mar 16, 9:53 am)