Re: sched_clock() uses are broken

Mike Galbraith
2006-05-08T04:37:44Z

On Mon, 2006-05-08 at 06:15 +0200, Mike Galbraith wrote:
> On Sun, 2006-05-07 at 19:32 +0200, Mike Galbraith wrote:
> > 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.
>

Sorry for yet another reply, but running the old starvation testcase
that caused sched_clock() to be born in the first place tickled my
funny-bone. With that running and hitting 300k context switches...

now: 2100508962835 tick: 2100508972067 stamp: 2100508961220 total: 2906
now: 2101531243883 tick: 2101531251877 stamp: 2101531238543 total: 2924
now: 2102695422392 tick: 2102695431699 stamp: 2102695418265 total: 2940

Accounting? Not :)

-Mike