[Intel-gfx] [PATCH 4/5] drm/i915: Implement fair lru eviction across both rings.

Daniel Vetter daniel at ffwll.ch
Wed Aug 4 22:16:58 CEST 2010


On Wed, Aug 04, 2010 at 12:20:36PM +0100, Chris Wilson wrote:
> Based in a large part upon Daniel Vetter's implementation and adapted
> for handling multiple rings in a single pass.

I've thought some more about this and I'm not sold on the idea that your
One Scan to Rule Them All is any fairer than simply looping through all
outstanding requests, like this:

1. (Re-)scan the inactive list and return the hole if found.
2. If there are any outstanding requests, wait for one to finish (on any
ring), then go back to 1.
3. If there are no more outstanding requests issue a full gpu flush and
wait, then go back to 2.
4. All hope is lost (and even evict_everything shouldn't be able to pull
of miracles), return NULL.

This way active buffers are scanned in retiring order, whereas your code
scans them in issuing order. IMHO the former is the fairer approach for
eviction when both rings are busy. I also think the code would look
slightly less scary ;)

Of course, this way we scan the inactive lru list completely for every
outstanding request. But I don't think that's a problem because
a) the current code does it, too, and
b) we're stalling already, so there should be enough cpu power available.

-Daniel
-- 
Daniel Vetter
Mail: daniel at ffwll.ch
Mobile: +41 (0)79 365 57 48



More information about the Intel-gfx mailing list