> I assume it's one or both of these loops in arch/x86/xen/time.c
That looks plausible.
I think you refer to 38332cb9, "time: prevent the loop in
timespec_add_ns() from being optimised away".
while(unlikely(ns >= NSEC_PER_SEC)) {
+ /* The following asm() prevents the compiler from
+ * optimising this loop into a modulo operation. */
+ asm("" : "+r"(ns));
+
ns -= NSEC_PER_SEC;
a->tv_sec++;
}
It should be. The asm() arg tells GCC that the asm() could modify
"ns" in some way, so GCC cannot optimise away the loop, since it
doesn't have the required info about the induction variable to do
that.
Segher
--