lkml.org 
[lkml]   [2004]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [ck] Re: [announce] [patch] Voluntary Kernel Preemption Patch

* Ingo Molnar <mingo@elte.hu> wrote:

> it was reporting more accurate latencies, except that there were
> strange spikes of latencies. It turned out that for whatever reason,
> userspace RDTSC is not always reliable on my box (!).
>
> I've attached two fixes against latencytest - one makes rdtsc
> timestamps more reliable, the other one fixes an SMP bug in the kernel
> module (it would lock up under SMP otherwise.).

> static inline unsigned long long int rdtsc(void)
> {
> - unsigned long long int x;
> - __asm__ volatile ("rdtsc" : "=A" (x));
> - return x;
> + unsigned long long int x, y;
> + for (;;) {
> + __asm__ volatile ("rdtsc" : "=A" (x));
> + __asm__ volatile ("rdtsc" : "=A" (y));
> + if (y - x < 1000)
> + return y;
> + }
> }

the same fix should be done to latencytest0.42 too.

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

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:1.126 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site