[Intel-gfx] [PATCH 03/15] drm/i915: Only spin whilst waiting on the current request

Dave Gordon david.s.gordon at intel.com
Tue Dec 1 07:47:34 PST 2015


On 30/11/15 10:06, Tvrtko Ursulin wrote:
>
> On 29/11/15 08:48, Chris Wilson wrote:
>> Limit busywaiting only to the request currently being processed by the
>> GPU. If the request is not currently being processed by the GPU, there
>> is a very low likelihood of it being completed within the 2 microsecond
>> spin timeout and so we will just be wasting CPU cycles.
>>
>> v2: Check for logical inversion when rebasing - we were incorrectly
>> checking for this request being active, and instead busywaiting for
>> when the GPU was not yet processing the request of interest.
>>
>> v3: Try another colour for the seqno names.
>> v4: Another colour for the function names.

Adding a field in the request to track the sequence number of the 
previous request isn't ideal when considering the scheduler and 
preemption. But we've got a separate batch-in-progress sequence number 
in the hardware status page (also for use by TDR to check which batch is 
currently running), so you could use that. Then the check is simply

     curr = intel_read_status_page(ring, I915_BATCH_ACTIVE_SEQNO);
     if (curr != req->seqno)
         return -EAGAIN;

.DAve.


More information about the Intel-gfx mailing list