Re: [patch] sched: accurate user accounting

From: Mike Galbraith
Date: Mon Mar 26 2007 - 01:28:15 EST


On Mon, 2007-03-26 at 08:11 +0300, Al Boldi wrote:

> > + /* Sanity check. It should never go backwards or ruin accounting
> > */ + if (unlikely(now < p->last_ran))
> > + goto out_set;
>
> If sched_clock() goes backwards, why not fix it, instead of hacking around
> it?

When tasks change cpu, timestamp correction is attempted, but isn't
perfect (perfection: submit patch to read remote clock - people likely
toast poor submitter's buns very thoroughly). Timewarps happen, and
even on Intel processors there seems to be very small difference in TSCs
in the same package. (that's what instrumentation here said must be
true, possible booboos aside)

-Mike

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/