Re: 2.6.14-rc3-rt2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 5 Oct 2005, Ingo Molnar wrote:

>
> * Thomas Gleixner <[email protected]> wrote:
>
> > On Wed, 2005-10-05 at 10:29 -0400, Steven Rostedt wrote:
> > > Hmm, Ingo,
> > >
> > > Do you know why time goes backwards when I run hackbench as a realtime
> > > process?  I added the output of start and stop and it does seem to go
> > > backwards.
> > >
> > > Thomas?
> >
> > Yes. Thats happening. I moved the priority of softirq-timer above
> > hackbench priority and the problem goes away. I look into this
> > further.
>
> wouldnt hackbench then permanently starve run_timer_softirq(), and
> update_times() in particular?
>

It seems that the problem comes down to the call to getnstimeofday in
do_gettimeofday.

void getnstimeofday(struct timespec *ts)
{
	nsec_t delta;
	unsigned long seq;

	/* atomically read __monotonic_clock() */
	do {
		seq = read_seqbegin(&system_time_lock);

		delta = __monotonic_clock() - xtime_last_update;
		*ts = xtime_last_update_ts;

	} while (read_seqretry(&system_time_lock, seq));

	set_normalized_timespec(ts,
				ts->tv_sec,
				ts->tv_nsec + (long) delta);

}


I found that xtime_last_update is not updated while hackbench is running,
and the delta ends up being 16 billion and some change. So the call to
set_normalized_timespec overflows with the (long) delta.

-- Steve
-
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/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux