* Steven Rostedt <[email protected]> wrote: > static inline nsec_t __get_nsec_offset(void) > { > cycle_t cycle_now, cycle_delta; > nsec_t ns_offset; > > /* read clocksource */ > cycle_now = read_clocksource(clock); > > /* calculate the delta since the last timeofday_periodic_hook */ > cycle_delta = (cycle_now - cycle_last) & clock->mask; > > /* convert to nanoseconds */ > ns_offset = cyc2ns(clock, ntp_adj, cycle_delta); > > /* Special case for jiffies tick/offset based systems > * add arch specific offset > */ > ns_offset += arch_getoffset(); > > return ns_offset; > } > > cycle_now is 32 bits. If the clocksource overflows (which it can in > 30 seconds) the cyclec_delta will be wrong. isnt cycle_t 64 bits? Ingo - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: Ktimer / -rt9 (+custom) monotonic_clock going backwards.
- From: Steven Rostedt <[email protected]>
- Re: Ktimer / -rt9 (+custom) monotonic_clock going backwards.
- References:
- Ktimer / -rt9 (+custom) monotonic_clock going backwards.
- From: Steven Rostedt <[email protected]>
- Re: Ktimer / -rt9 (+custom) monotonic_clock going backwards.
- From: Thomas Gleixner <[email protected]>
- Re: Ktimer / -rt9 (+custom) monotonic_clock going backwards.
- From: john stultz <[email protected]>
- Re: Ktimer / -rt9 (+custom) monotonic_clock going backwards.
- From: Steven Rostedt <[email protected]>
- Re: Ktimer / -rt9 (+custom) monotonic_clock going backwards.
- From: Ingo Molnar <[email protected]>
- Re: Ktimer / -rt9 (+custom) monotonic_clock going backwards.
- From: Steven Rostedt <[email protected]>
- Re: Ktimer / -rt9 (+custom) monotonic_clock going backwards.
- From: Ingo Molnar <[email protected]>
- Re: Ktimer / -rt9 (+custom) monotonic_clock going backwards.
- From: Steven Rostedt <[email protected]>
- Ktimer / -rt9 (+custom) monotonic_clock going backwards.
- Prev by Date: Re: Ktimer / -rt9 (+custom) monotonic_clock going backwards.
- Next by Date: Re: Ktimer / -rt9 (+custom) monotonic_clock going backwards.
- Previous by thread: Re: Ktimer / -rt9 (+custom) monotonic_clock going backwards.
- Next by thread: Re: Ktimer / -rt9 (+custom) monotonic_clock going backwards.
- Index(es):