lkml.org 
[lkml]   [2005]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: 2.6.14-rc4-rt7
Steven Rostedt wrote:
> On Thu, 2005-10-27 at 09:01 +0100, Rui Nuno Capela wrote:
>
>
>>Don't really know if its consistent, but it does occur on several times,
>>on only on boot.
>
>
> Rui,
>
> Have you tried the last patch that I sent John? It may just be a race
> condition in the checking that causes a false positive. My last patch
> fixes that.
>
> -- Steve
>

So far so good.

Tks.
--
rncbc aka Rui Nuno Capela
rncbc@rncbc.org
--- linux-2.6.14-rc5-rt7.0/kernel/time/timeofday.c 2005-10-26 16:57:03.000000000 -0400
+++ linux-2.6.14-rc5-rt7.1/kernel/time/timeofday.c 2005-10-26 22:10:32.000000000 -0400
@@ -232,6 +232,12 @@
unsigned long seq;
ktime_t prev, now;
nsec_t mc, prev_st, curr_st;
+ unsigned long flags;
+
+ raw_local_irq_save(flags);
+ prev = per_cpu(prev_mono_time, cpu);
+ prev_st = per_cpu(prev_system_time, cpu);
+ raw_local_irq_restore(flags);

/* atomically read __get_monotonic_clock_ns() */
do {
@@ -242,11 +248,7 @@
} while (read_seqretry(&system_time_lock, seq));

ns_to_timespec(ts, mc);
-
now = timespec_to_ktime(*ts);
- prev = per_cpu(prev_mono_time, cpu);
-
- prev_st = per_cpu(prev_system_time, cpu);
curr_st = system_time;

if (ktime_cmp(now, <, prev)) {
@@ -264,8 +266,12 @@
ktime_to_timespec(ts, prev);
return;
}
+
+ raw_local_irq_save(flags);
per_cpu(prev_mono_time, cpu) = now;
per_cpu(prev_system_time, cpu) = system_time;
+ raw_local_irq_restore(flags);
+
put_cpu();
}

\
 
 \ /
  Last update: 2005-10-28 01:21    [W:0.395 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site