lkml.org 
[lkml]   [2005]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch 15/21] hrtimer core code
From
Date
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/

\
 
 \ /
  Last update: 2005-12-15 04:50    [W:1.833 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site