Re: [PATCH] drm/i915: Honour O_NONBLOCK before throttling execbuf submissions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Chris Wilson (2019-10-10 14:48:49)
> Check the user's flags on the struct file before deciding whether or not
> to stall before submitting a request. This allows us to reasonably
> cheaply honour O_NONBLOCK without checking at more critical phases
> during request submission.
> 
> Suggested-by: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
> Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
> ---
>  .../gpu/drm/i915/gem/i915_gem_execbuffer.c    | 21 ++++++++++++-------
>  1 file changed, 14 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> index 98816c35ffc3..bc6bcb8f6d79 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> @@ -2189,15 +2189,22 @@ static int __eb_pin_engine(struct i915_execbuffer *eb, struct intel_context *ce)
>         intel_context_timeline_unlock(tl);
>  
>         if (rq) {
> -               if (i915_request_wait(rq,
> -                                     I915_WAIT_INTERRUPTIBLE,
> -                                     MAX_SCHEDULE_TIMEOUT) < 0) {
> -                       i915_request_put(rq);
> -                       err = -EINTR;
> -                       goto err_exit;
> -               }
> +               bool nonblock = eb->file->filp->f_flags & O_NONBLOCK;
> +               long timeout;

The alternative or addendum would be to use an execbuf.flag to opt out
of throttling. O_NONBLOCK seems fitting though.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux