Messages in this thread | | | Subject | Re: [patch 15/21] hrtimer core code | From | Matt Helsley <> | Date | Wed, 14 Dec 2005 19:43:01 -0800 |
| |
On Tue, 2005-12-06 at 01:01 +0100, tglx@linutronix.de wrote: <snip>
> Index: linux-2.6.15-rc5/kernel/hrtimer.c > =================================================================== > --- /dev/null > +++ linux-2.6.15-rc5/kernel/hrtimer.c
<snip>
> +/** > + * ktime_get_ts - get the monotonic clock in timespec format > + * > + * @ts: pointer to timespec variable > + * > + * The function calculates the monotonic clock from the realtime > + * clock and the wall_to_monotonic offset and stores the result > + * in normalized timespec format in the variable pointed to by ts. > + */ > +void ktime_get_ts(struct timespec *ts) > +{ > + struct timespec tomono; > + unsigned long seq; > + > + do { > + seq = read_seqbegin(&xtime_lock); > + getnstimeofday(ts); > + tomono = wall_to_monotonic; > + > + } while (read_seqretry(&xtime_lock, seq)); > + > + set_normalized_timespec(ts, ts->tv_sec + tomono.tv_sec, > + ts->tv_nsec + tomono.tv_nsec); > +}
<snip>
unlike many other places I've seen the loop structure: do { seq = read_seqbegin(&xtime_lock); ... } while (unlikely(read_seqretry(&xtime_lock, seq)));
This one lacks the unlikely() in the loop condition. Do high res timers tend to make the branch hint incorrect?
Thanks, -Matt Helsley
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |