diff mbox series

[1/2] drm/i915: Flush execution tasklets before checking request status

Message ID 20200205095441.1769599-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/i915: Flush execution tasklets before checking request status | expand

Commit Message

Chris Wilson Feb. 5, 2020, 9:54 a.m. UTC
Rather than flushing the submission tasklets just before we sleep, flush
before we check the request status. Ideally this gives us a moment to
process the tasklets after sleeping just before we timeout.

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

Comments

Mika Kuoppala Feb. 5, 2020, 2:42 p.m. UTC | #1
Chris Wilson <chris@chris-wilson.co.uk> writes:

> Rather than flushing the submission tasklets just before we sleep, flush
> before we check the request status. Ideally this gives us a moment to
> process the tasklets after sleeping just before we timeout.

Makes sense to check the possibly most recent state.

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/i915_request.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
> index f56b046a32de..5c2bb0b9478b 100644
> --- a/drivers/gpu/drm/i915/i915_request.c
> +++ b/drivers/gpu/drm/i915/i915_request.c
> @@ -1564,6 +1564,7 @@ long i915_request_wait(struct i915_request *rq,
>  		goto out;
>  
>  	for (;;) {
> +		intel_engine_flush_submission(rq->engine);
>  		set_current_state(state);
>  
>  		if (i915_request_completed(rq)) {
> @@ -1581,7 +1582,6 @@ long i915_request_wait(struct i915_request *rq,
>  			break;
>  		}
>  
> -		intel_engine_flush_submission(rq->engine);
>  		timeout = io_schedule_timeout(timeout);
>  	}
>  	__set_current_state(TASK_RUNNING);
> -- 
> 2.25.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Chris Wilson Feb. 5, 2020, 3:36 p.m. UTC | #2
Quoting Mika Kuoppala (2020-02-05 14:42:16)
> Chris Wilson <chris@chris-wilson.co.uk> writes:
> 
> > Rather than flushing the submission tasklets just before we sleep, flush
> > before we check the request status. Ideally this gives us a moment to
> > process the tasklets after sleeping just before we timeout.
> 
> Makes sense to check the possibly most recent state.
> 
> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

I suppose I should mention a small counter argument is that by kicking
ksoftirqd before checking completed, we may add a small amount of
latency to the ready client.

A compromise is to kick before timeout?
-Chris
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index f56b046a32de..5c2bb0b9478b 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -1564,6 +1564,7 @@  long i915_request_wait(struct i915_request *rq,
 		goto out;
 
 	for (;;) {
+		intel_engine_flush_submission(rq->engine);
 		set_current_state(state);
 
 		if (i915_request_completed(rq)) {
@@ -1581,7 +1582,6 @@  long i915_request_wait(struct i915_request *rq,
 			break;
 		}
 
-		intel_engine_flush_submission(rq->engine);
 		timeout = io_schedule_timeout(timeout);
 	}
 	__set_current_state(TASK_RUNNING);