Messages in this thread | | | Date | Sun, 11 Jul 2004 22:17:53 +0200 | From | Ingo Molnar <> | Subject | Re: [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/
| |