In article <20111025150023.GA13544@marx.bitnet>, Jukka Ruohonen <jruoho...@iki.fi> wrote: >On Tue, Oct 25, 2011 at 02:36:50PM +0000, Christos Zoulas wrote: >> We really want to be switching most things in the kernel to timespec from >> timeval not the other way around? > >A case came up where the transition latencies are very high, and I'd like >to still use uint64_t. The precision is hardly important here (something >like 10 * usec is fine).
In this case a simple change from: s += ntb.tv_nsec; to: s += ntb.tv_nsec / 1000; would have been sufficient since the division is outside the critical sampling section. You could remove the unneeded 0 assignments above the critical section too to gain back the lost code size :-). >> This is backwards as things tend to become faster instead of slower. > >In this case (the sampling itself) things might even become slower (i.e. >more CPUs), mainly due NetBSD (xcall), but still. Could be, but in the long term I prefer us to have only one timing scale in the kernel to avoid conversions, confusion, and gain back some efficiency in the basic timekeeping code which now needs to keep track of both micros and nanos. christos