[PATCH] dix: Fix Client starvation with SmartScheduler priorities
Keith Packard
keithp at keithp.com
Wed Jan 22 11:04:28 PST 2014
Chris Wilson <chris at chris-wilson.co.uk> writes:
> The solution employed here is to undo the busy demotion after a period
> of idleness. Currently the idle boost is applied only once for a fresh
> client when it becomes selectable. The change is to apply that boost for
> all clients that remain ready for the entire duration of idle timeslice -
> eventually these old busy clients will be promoted sufficiently to
> be granted a ScheduleSlice.
I think your analysis is spot-on, but the fix doesn't seem to match. By
changing smart_check_tick only when it is older than 'idle', you're
effectively just bumping smart_priority every other pass through the
loop. Which explains why you get no starvation; all ready clients get priority
bumps every other pass through the loop. But that includes the clients
which are actually running, which definitely isn't what we want.
I think what we want to do is simply increase the priority of clients
which haven't run in a while, instead of clients which haven't been
ready for a while. That's easy to check; we know the last time a client
ran as that's stored in smart_start_tick.
Please give this patch a try and see if it has the same effect.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-dix-Praise-clients-which-haven-t-run-for-a-while-rat.patch
Type: text/x-diff
Size: 2104 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20140122/9d63eac6/attachment.patch>
-------------- next part --------------
--
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20140122/9d63eac6/attachment.pgp>
More information about the xorg-devel
mailing list