[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20060807110748.GL27757@suse.cz>
Date: Mon, 7 Aug 2006 13:07:48 +0200
From: Vojtech Pavlik <vojtech@...e.cz>
To: Dmitry Torokhov <dtor@...ightbb.com>
Cc: Andi Kleen <ak@....de>, Rusty Russell <rusty@...tcorp.com.au>,
lkml - Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Turn rdmsr, rdtsc into inline functions, clarify names
On Sun, Aug 06, 2006 at 10:43:44PM -0400, Dmitry Torokhov wrote:
> On Saturday 05 August 2006 23:16, Andi Kleen wrote:
> > This whole thing is broken, e.g. on a preemptive kernel when the
> > code can switch CPUs
>
> Would not preempt_disable fix that?
>
> > Dmitry, I would suggest to convert it over to do_gettimeofday and remove
> > all the architecture ifdefs.
> >
> > Or maybe just remove it completely. Who cares about the speed of a gameport
> > anyways? And why can't they measure it in user space?
>
> Analog driver uses it to adjust timing. Vojtech should have more background
> on that..
The gameport speed is used by digital-over-gameport joystick drivers to
keep track of time based on the number of inb()s done to the gameport.
We can't use anything slower than rdtsc there, and since rdtsc isn't
always available, the count of inb()s is the best approximation.
The speed can't easily be measured in userspace - you need to make sure
IRQs, DMA and other stuff doesn't interfere with the measurement, which
needs to be rather exact. AND, you need it for the kernel to work, so it
doesn't make sense to move it to an userspace tool that the kernel would
have to call.
The analog joystick driver does even more timing magic to get precise
readings from the port, where the value read depends on the time for a
bit on the port to change from 0 to 1.
I agree that gameports are mostly dead today, but people are still using
them.
--
Vojtech Pavlik
Director SuSE Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists