[Intel-gfx] [PATCH] drm/i915/gvt: Remove bogus retry around i915_wait_request

Dong, Chuanxiao chuanxiao.dong at intel.com
Mon Mar 13 09:35:00 UTC 2017



> -----Original Message-----
> From: intel-gvt-dev [mailto:intel-gvt-dev-bounces at lists.freedesktop.org] On
> Behalf Of Chris Wilson
> Sent: Monday, March 13, 2017 5:28 PM
> To: Dong, Chuanxiao <chuanxiao.dong at intel.com>
> Cc: intel-gfx at lists.freedesktop.org; intel-gvt-dev at lists.freedesktop.org;
> Zhenyu Wang <zhenyuw at linux.intel.com>; Wang, Zhi A
> <zhi.a.wang at intel.com>
> Subject: Re: [PATCH] drm/i915/gvt: Remove bogus retry around
> i915_wait_request
> 
> On Mon, Mar 13, 2017 at 09:21:58AM +0000, Dong, Chuanxiao wrote:
> >
> >
> > > -----Original Message-----
> > > From: intel-gvt-dev
> > > [mailto:intel-gvt-dev-bounces at lists.freedesktop.org] On Behalf Of
> > > Dong, Chuanxiao
> > > Sent: Thursday, March 9, 2017 9:28 AM
> > > To: Chris Wilson <chris at chris-wilson.co.uk>;
> > > intel-gfx at lists.freedesktop.org
> > > Cc: intel-gvt-dev at lists.freedesktop.org; Wang, Zhi A
> > > <zhi.a.wang at intel.com>; Zhenyu Wang <zhenyuw at linux.intel.com>
> > > Subject: RE: [PATCH] drm/i915/gvt: Remove bogus retry around
> > > i915_wait_request
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Chris Wilson [mailto:chris.ickle.wilson at gmail.com] On Behalf
> > > > Of Chris Wilson
> > > > Sent: Thursday, March 9, 2017 6:08 AM
> > > > To: intel-gfx at lists.freedesktop.org
> > > > Cc: intel-gvt-dev at lists.freedesktop.org; Chris Wilson
> > > > <chris at chris- wilson.co.uk>; Dong, Chuanxiao
> > > > <chuanxiao.dong at intel.com>; Zhenyu
> > > Wang
> > > > <zhenyuw at linux.intel.com>; Wang, Zhi A <zhi.a.wang at intel.com>
> > > > Subject: [PATCH] drm/i915/gvt: Remove bogus retry around
> > > > i915_wait_request
> > > >
> > > > commit 8f1117abb408 ("drm/i915/gvt: handle workload lifecycle
> > > > properly") includes some nonsense to retry a indefinite wait -
> > > > i915_wait_request() does not return until the request is completed
> > > > when used from an uninterruptible context.
> > > >
> > > > Fixes: 8f1117abb408 ("drm/i915/gvt: handle workload lifecycle
> properly"
> > > > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > > > Cc: Chuanxiao Dong <chuanxiao.dong at intel.com>
> > > > Cc: Zhenyu Wang <zhenyuw at linux.intel.com>
> > > > Cc: Zhi Wang <zhi.a.wang at intel.com>
> > > > ---
> > > >  drivers/gpu/drm/i915/gvt/scheduler.c | 14 +-------------
> > > >  1 file changed, 1 insertion(+), 13 deletions(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c
> > > > b/drivers/gpu/drm/i915/gvt/scheduler.c
> > > > index cfd9f7a38c27..8024904c0d58 100644
> > > > --- a/drivers/gpu/drm/i915/gvt/scheduler.c
> > > > +++ b/drivers/gpu/drm/i915/gvt/scheduler.c
> > > > @@ -465,19 +465,7 @@ static int workload_thread(void *priv)
> > > >
> > > >  		gvt_dbg_sched("ring id %d wait workload %p\n",
> > > >  				workload->ring_id, workload);
> > > > -retry:
> > > > -		i915_wait_request(workload->req,
> > > > -					 0, MAX_SCHEDULE_TIMEOUT);
> > > > -		/* I915 has replay mechanism and a request will be replayed
> > > > -		 * if there is i915 reset. So the seqno will be updated anyway.
> > > > -		 * If the seqno is not updated yet after waiting, which means
> > > > -		 * the replay may still be in progress and we can wait again.
> > > > -		 */
> > > > -		if (!i915_gem_request_completed(workload->req)) {
> > > > -			gvt_dbg_sched("workload %p not completed, wait
> > > > again\n",
> > > > -					workload);
> > > > -			goto retry;
> > > > -		}
> > > > +		i915_wait_request(workload->req, 0,
> > > > MAX_SCHEDULE_TIMEOUT);
> > >
> > > Thanks Chris for pointing this out. So per the comment,
> > > i915_wait_request will make sure to return until the request
> > > completed, even if a GPU hang happened and replay occurred during
> > > i915_wait_request(), this function will only return after the replay
> completed, right?
> >
> > Hi Chris, ping for the above question. I guess the answer is "yes"?
> 
> Yes. Given MAX_SCHEDULE_TIMEOUT, no INTERRUPTIBLE flags, it will only
> return once the request is completed - that is the hw breadcrumb is advanced
> past the request seqno. That includes waiting across a GPU reset. It is not
> allowed to return another error.

I see. Thanks Chris. My understanding was i915_wait_request() will return without waiting for the replay. Thanks for the fix. :)

Thanks
Chuanxiao

> -Chris
> 
> --
> Chris Wilson, Intel Open Source Technology Centre
> _______________________________________________
> intel-gvt-dev mailing list
> intel-gvt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev


More information about the Intel-gfx mailing list