Re: [PATCH_TAKE_2] now < last_tick problem

From: David Mosberger <>
Date: 2003-10-14 15:23:39
>>>>> On Tue, 14 Oct 2003 09:06:21 +1000, Ian Wienand <> said:

  Ian> That was my point, sorry.

  Ian> do_gettimeofday() does

  Ian>  while (1) {
  Ian>                seq = read_seqbegin(&xtime_lock);
  Ian>                {
  Ian>                        old = last_nsec_offset;
  Ian>                        offset = time_interpolator_get_offset();
  Ian>                        sec = xtime.tv_sec;
  Ian>                        nsec = xtime.tv_nsec;
  Ian>                }
  Ian>                if (unlikely(read_seqretry(&xtime_lock, seq)))
  Ian>                        continue;
  Ian>  ... and so on ...
  Ian> }

  Ian> Previously, if that read_seqbegin was some kind of irq save lock, then
  Ian> time_interpolator_get_offset() (which is itc_get_offset()) should
  Ian> never have been interrupted (especially by the timer interrupt), and
  Ian> the warning message (now < last_tick) meant something was wrong.
  Ian> Using synchronisation, it's probable that itc_get_offset() will be
  Ian> interrupted every now and then, but do_gettimeofday() will keep
  Ian> retrying it till read_seqretry informs it that read the right values.

  Ian> So the warning message in itc_get_offset isn't really needed?

Hmmh, I seem to have misremembered the code.  I thought we updated
last_nsec_offset _before_ read_seqretry(), but that's not the case.  I
think you may be right that we can simply delete the (bogus)
consistency-check.  May want to add a comment about that, though.

To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to
More majordomo info at
Received on Tue Oct 14 01:24:14 2003

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:19 EST