diff mbox series

[4/8] drm/i915/gt: Kick virtual siblings on timeslice out

Message ID 20200518081440.17948-4-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series [1/8] drm/i915: Move saturated workload detection back to the context | expand

Commit Message

Chris Wilson May 18, 2020, 8:14 a.m. UTC
If we decide to timeslice out the current virtual request, we will
unsubmit it while it is still busy (ve->context.inflight == sibling[0]).
If the virtual tasklet and then the other sibling tasklets run before we
completely schedule out the active virtual request for the preemption,
those other tasklets will see that the virtul request is still inflight
on sibling[0] and leave it be. Therefore when we finally schedule-out
the virtual request and if we see that we have passed it back to the
virtual engine, reschedule the virtual tasklet so that it may be
resubmitted on any of the siblings.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gt/intel_lrc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tvrtko Ursulin May 18, 2020, 10:29 a.m. UTC | #1
On 18/05/2020 09:14, Chris Wilson wrote:
> If we decide to timeslice out the current virtual request, we will
> unsubmit it while it is still busy (ve->context.inflight == sibling[0]).
> If the virtual tasklet and then the other sibling tasklets run before we
> completely schedule out the active virtual request for the preemption,
> those other tasklets will see that the virtul request is still inflight
> on sibling[0] and leave it be. Therefore when we finally schedule-out
> the virtual request and if we see that we have passed it back to the
> virtual engine, reschedule the virtual tasklet so that it may be
> resubmitted on any of the siblings.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/gt/intel_lrc.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
> index 80885ba87db5..05486e801a63 100644
> --- a/drivers/gpu/drm/i915/gt/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
> @@ -1402,7 +1402,7 @@ static void kick_siblings(struct i915_request *rq, struct intel_context *ce)
>   	struct virtual_engine *ve = container_of(ce, typeof(*ve), context);
>   	struct i915_request *next = READ_ONCE(ve->request);
>   
> -	if (next && next->execution_mask & ~rq->execution_mask)
> +	if (next == rq || (next && next->execution_mask & ~rq->execution_mask))
>   		tasklet_hi_schedule(&ve->base.execlists.tasklet);
>   }
>   
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
index 80885ba87db5..05486e801a63 100644
--- a/drivers/gpu/drm/i915/gt/intel_lrc.c
+++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
@@ -1402,7 +1402,7 @@  static void kick_siblings(struct i915_request *rq, struct intel_context *ce)
 	struct virtual_engine *ve = container_of(ce, typeof(*ve), context);
 	struct i915_request *next = READ_ONCE(ve->request);
 
-	if (next && next->execution_mask & ~rq->execution_mask)
+	if (next == rq || (next && next->execution_mask & ~rq->execution_mask))
 		tasklet_hi_schedule(&ve->base.execlists.tasklet);
 }