Re: 2.6.14-rc3-rt2

From: Steven Rostedt
Date: Fri Oct 07 2005 - 06:09:16 EST




On Wed, 5 Oct 2005, Steven Rostedt wrote:

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

OK, not sure if anyone looked into this more or not. But this patch seems
to at least fix the symptom if not the cure. I changed
set_normalize_timespec to take a nsec_t type as its last parameter.
Since I don't see a problem with overflowing a 64 bit number, this works
for now. But I still don't know the full extent of xtime_last_update not
updating during something like hackbench starving the timer softirq.

-- Steve

Index: linux-rt-quilt/include/linux/time.h
===================================================================
--- linux-rt-quilt.orig/include/linux/time.h 2005-10-07 05:11:00.000000000 -0400
+++ linux-rt-quilt/include/linux/time.h 2005-10-07 05:12:17.000000000 -0400
@@ -107,7 +107,7 @@
extern struct timespec timespec_trunc(struct timespec t, unsigned gran);

static inline void
-set_normalized_timespec (struct timespec *ts, time_t sec, long nsec)
+set_normalized_timespec (struct timespec *ts, time_t sec, nsec_t nsec)
{
while (nsec > NSEC_PER_SEC) {
nsec -= NSEC_PER_SEC;
Index: linux-rt-quilt/kernel/timeofday.c
===================================================================
--- linux-rt-quilt.orig/kernel/timeofday.c 2005-10-06 08:04:56.000000000 -0400
+++ linux-rt-quilt/kernel/timeofday.c 2005-10-07 05:14:58.000000000 -0400
@@ -174,12 +174,12 @@
goto full;
set_normalized_timespec(&mono_last_update_ts,
mono_last_update_ts.tv_sec,
- mono_last_update_ts.tv_nsec + (long) delta);
+ mono_last_update_ts.tv_nsec + delta);
if (unlikely(leapupdate))
set_normalized_timespec(&mono_wall_offset_ts,
mono_wall_offset_ts.tv_sec,
mono_wall_offset_ts.tv_nsec +
- (long) leapupdate);
+ leapupdate);
}
xtime_last_update = system_time;
set_normalized_timespec(&xtime,
@@ -266,7 +266,7 @@

set_normalized_timespec(ts,
mono_last_update_ts.tv_sec,
- mono_last_update_ts.tv_nsec + (long) delta);
+ mono_last_update_ts.tv_nsec + delta);
}

/**
@@ -359,7 +359,7 @@

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

}
EXPORT_SYMBOL(getnstimeofday);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/