[PATCH] EXA: Defragment offscreen memory.

Adam Jackson ajax at nwnk.net
Tue Feb 17 12:26:53 PST 2009


On Sat, 2009-02-14 at 19:03 +0100, Michel Dänzer wrote:
> On Sat, 2009-02-14 at 09:01 -0800, Keith Packard wrote:
> > On Sat, 2009-02-14 at 14:28 +0100, Michel Dänzer wrote:
> > 
> > > * The server is going idle.
> > 
> > The server calls the block handler every 20ms, not just when it is truly
> > idle.
> 
> You learn something new every day...

To clarify:

As long as a single client has work to do, within the scheduler's
timeslice (which is 20ms unless you hack your server), the server will
continue to process requests from that client.  As soon as either
there's no more work to do for that client, or the timeslice expires,
we'll schedule another client, at which point we'll call BlockHandler.

It's a slightly misleading name, but it's hard to come up with a good
name.  OnClientAttend/OnClientUnattend maybe, except those names are
already used for server grabs...

> > If this operation is expensive, you may want to hack up the block
> > and wakeup handlers to pend this until the server actually ended up
> > sleeping.
> 
> How can I tell that? It shouldn't be too expensive usually and will only
> actually run at most once per second anyway, but it would probably still
> be better only to do it when the server is idle if that can be achieved
> without too much effort.

Probably better to run the periodic defragger from a real timer, and arm
it for 1s in the future from BlockHandler.  If the timer ever expires,
you know you've been idle for a full second, so you can go ahead and do
some idle work.  (Eventually, when you detect that you're as defragged
as you're going to get, just destroy the timer.)  Technically this has a
minor failing when a single request takes more than a second but if that
ever happens you're not a happy camper anyway.

There's some need for a more general idle work framework in the server
core, for things like LVDS reclocking.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.x.org/archives/xorg-devel/attachments/20090217/8e695585/attachment.pgp 


More information about the xorg-devel mailing list