Re: sched_clock() uses are broken

Mike Galbraith
2006-05-07T17:32:04Z

On Sun, 2006-05-07 at 22:33 +1000, Nick Piggin wrote:
> Mike Galbraith wrote:
> > On Wed, 2006-05-03 at 03:07 +1000, Nick Piggin wrote:
> >
> >>Other problem is that some people didn't RTFM and have started trying to
> >>use it for precise accounting :(
> >
> >
> > Are you talking about me perchance? I don't really care about precision
> > _that_ much, though I certainly do want to tighten timeslice accounting.
>
> No, sched_clock is fine to be used in CPU scheduling choices, which are
> heuristic anyway (although strictly speaking, even using it for timeslicing
> within a single CPU could cause slight unfairness).
>
> I'm talking about the update_cpu_clock() / task_struct->sched_time stuff.

Oh. I kinda sorta agree. If the continuous nanosecond thing happens,
it'll make things _much_ easier. I actually have exactly one testcase
that actually requires nanoseconds as things stand, and that one I've
worked around in the past. The rest of my desire to increase accuracy
stems from instrumenting timeslice enforcement. Statistical at best,
and truly sad at worst.

-Mike