Xorg input thread (2)
Keith Packard
keithp at keithp.com
Sun Jul 8 00:33:40 PDT 2007
On Sun, 2007-07-08 at 03:23 -0300, Tiago Vignatti wrote:
> Just to be clear, the current input thread is not using SIGIO. It's only
> using a poll(2) to monitor the device's sockets.
That is as desired -- a thread that just blocks on the appropriate file
descriptors in the kernel.
> And Jesse, to be fair, I just tried a little with mlock. I spent more
> time with mlockall (which is much easier to play than mlock) seeing
> whether the cursor lags or not. My little results with mlockall
> demonstrates that we can obtain a smooth mouse only increasing 3MB of
> "always resident memory".
So, you use MCL_CURRENT to lock the pages present in the server at
startup time? If so, this could answer the question of whether the
presence of other paging going on within the X server would affect the
locked pages used by the mouse thread.
If the mouse thread is independent of other X server paging, we could
(fairly) easily identify all of the functions that are involved in mouse
motion, place them in a separate ELF segment and then mlock them when
the server starts. While ugly, this seems fairly non-invasive.
> a. Initially I think that you had discarded mlock. But now I'll invest
> time on this and come with more exactly values of experimentation.
Using ELF tricks, we may actually be able to usefully use mlock for this
operation.
> b. try to investigate a little the DRM/DRI things towards something like
> the Ultrix systems which Keith talked. Keith, could you point where can
> we find that old Ultrix code which you mentioned?
The kernel code is probably long gone (it was closed source, after all).
Nor can I get any documentation at this point, but you can see the
ancient dec DDX directory in the CVS attic on freedesktop.org:
http://webcvs.freedesktop.org/xorg/xc/programs/Xserver/hw/dec/?hideattic=0
The 'ws' directory has the newer kernel interface, the qvss and qdss
directories have older interfaces; qvss is likely the easier of those
two to read.
You might also ask Jim Gettys <jg at laptop.org> and see if he has anything
lying around he can share.
This interface included a shared memory ring buffer between kernel and X
server for input events; that made the check for input very cheap,
although SIGIO is not a terrible replacement for that. Mostly, the parts
that are interesting now are the kernel interface for controlling the
acceleration and visible cursor image.
--
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg/attachments/20070708/6dc7d0ce/attachment.pgp>
More information about the xorg
mailing list