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

2010-08-04 Thread Daniel Vetter
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: dan...@ffwll.ch
Mobile: +41 (0)79 365 57 48
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


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

2010-08-04 Thread Chris Wilson
On Wed, 4 Aug 2010 22:16:58 +0200, Daniel Vetter dan...@ffwll.ch wrote:
 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 ;)

Hmm, I was aiming for retiring order, I may have missed. But yes, the true
goal is for this to be clear from the code, and here my preference was for
unrolling the loop so that the order was apparent. Obviously I have failed
on one or both accounts.

-- 
Chris Wilson, Intel Open Source Technology Centre
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx