Re: [Patch 1/4] Delay accounting: Initialization

From: Marcelo Tosatti
Date: Tue Nov 15 2005 - 07:00:55 EST


On Mon, Nov 14, 2005 at 08:20:17PM -0800, Andrew Morton wrote:
> Shailabh Nagar <nagar@xxxxxxxxxxxxxx> wrote:
> >
> > + *ts = sched_clock();
>
> I'm not sure that it's kosher to use sched_clock() for fine-grained
> timestamping like this. Ingo had issues with it last time this happened?

If the system boots with use_rtc == 0 you're going to get jiffies based
resolution from sched_clock(). I have a 1GHz Pentium 3 around here which
does that.

Maybe use do_gettimeofday() for such systems?

Would be nice to have a sort of per-arch overridable "gettime()" function?

> <too lazy to read all the code> Do you normalise these numbers in some
> manner before presenting them to userspace? If so, by what means?
-
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/