Xserver and Gettimeofday

Keith Packard keithp at keithp.com
Wed Aug 29 21:07:47 PDT 2007


On Wed, 2007-08-29 at 11:08 +0200, Xavier Bestel wrote:

> Keith said that the X scheduler consumes gettimeofday() calls to ensure
> tasks don't run for more than 20ms. As this kind of time measurement
> doesn't seem to require high precision, maybe simply using the TSC (when
> available) is enough ?

It actually takes a timer signal every 20ms instead of calling
gettimeofday for this purpose. Unfortunately, we also have many spin
loops that wait for the hardware to finish some operation, and those
generally want to timeout when the hardware locks up. Those call
gettimeofday repeatedly, and while it looks bad on a profile, it's
really just spinning through the kernel rather than sitting solely in
user space spinning.

Yes, we will make these stop spinning and block on an interrupt. And,
yes, this requires rewriting most of the driver acceleration code.

-- 
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/20070829/23e73e81/attachment.pgp>


More information about the xorg mailing list