diff mbox series

[3/3] drm/i915: Do not use reserved requests for virtual engines

Message ID 20220614184348.23746-4-ramalingam.c@intel.com (mailing list archive)
State New, archived
Headers show
Series Break VM to rq reference loop | expand

Commit Message

Ramalingam C June 14, 2022, 6:43 p.m. UTC
Do not use reserved requests for virtual engines as this is only
needed for kernel contexts.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
Suggested-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/i915/i915_request.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Matthew Brost June 27, 2022, 5:18 p.m. UTC | #1
On Wed, Jun 15, 2022 at 12:13:48AM +0530, Ramalingam C wrote:
> Do not use reserved requests for virtual engines as this is only
> needed for kernel contexts.
> 
> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
> Suggested-by: Matthew Brost <matthew.brost@intel.com>

With the patch squashed into the previous patch:
Reviewed-by: Matthew Brost <matthew.brost@intel.com>

> ---
>  drivers/gpu/drm/i915/i915_request.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
> index c71905d8e154..f0392b053bca 100644
> --- a/drivers/gpu/drm/i915/i915_request.c
> +++ b/drivers/gpu/drm/i915/i915_request.c
> @@ -135,6 +135,8 @@ static void i915_fence_release(struct dma_fence *fence)
>  
>  	/*
>  	 * Keep one request on each engine for reserved use under mempressure
> +	 * do not use with virtual engines as this really is only needed for
> +	 * kernel contexts.
>  	 *
>  	 * We do not hold a reference to the engine here and so have to be
>  	 * very careful in what rq->engine we poke. The virtual engine is
> @@ -164,7 +166,8 @@ static void i915_fence_release(struct dma_fence *fence)
>  	 * know that if the rq->execution_mask is a single bit, rq->engine
>  	 * can be a physical engine with the exact corresponding mask.
>  	 */
> -	if (is_power_of_2(rq->execution_mask) &&
> +	if (!intel_engine_is_virtual(rq->engine) &&
> +	    is_power_of_2(rq->execution_mask) &&
>  	    !cmpxchg(&rq->engine->request_pool, NULL, rq))
>  		return;
>  
> -- 
> 2.20.1
>
Ramalingam C June 27, 2022, 6:01 p.m. UTC | #2
On 2022-06-27 at 10:18:59 -0700, Matthew Brost wrote:
> On Wed, Jun 15, 2022 at 12:13:48AM +0530, Ramalingam C wrote:
> > Do not use reserved requests for virtual engines as this is only
> > needed for kernel contexts.
> > 
> > Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
> > Suggested-by: Matthew Brost <matthew.brost@intel.com>
> 
> With the patch squashed into the previous patch:
> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Thank you Matthew. I will squash them while merging.

Ram
> 
> > ---
> >  drivers/gpu/drm/i915/i915_request.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
> > index c71905d8e154..f0392b053bca 100644
> > --- a/drivers/gpu/drm/i915/i915_request.c
> > +++ b/drivers/gpu/drm/i915/i915_request.c
> > @@ -135,6 +135,8 @@ static void i915_fence_release(struct dma_fence *fence)
> >  
> >  	/*
> >  	 * Keep one request on each engine for reserved use under mempressure
> > +	 * do not use with virtual engines as this really is only needed for
> > +	 * kernel contexts.
> >  	 *
> >  	 * We do not hold a reference to the engine here and so have to be
> >  	 * very careful in what rq->engine we poke. The virtual engine is
> > @@ -164,7 +166,8 @@ static void i915_fence_release(struct dma_fence *fence)
> >  	 * know that if the rq->execution_mask is a single bit, rq->engine
> >  	 * can be a physical engine with the exact corresponding mask.
> >  	 */
> > -	if (is_power_of_2(rq->execution_mask) &&
> > +	if (!intel_engine_is_virtual(rq->engine) &&
> > +	    is_power_of_2(rq->execution_mask) &&
> >  	    !cmpxchg(&rq->engine->request_pool, NULL, rq))
> >  		return;
> >  
> > -- 
> > 2.20.1
> >
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index c71905d8e154..f0392b053bca 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -135,6 +135,8 @@  static void i915_fence_release(struct dma_fence *fence)
 
 	/*
 	 * Keep one request on each engine for reserved use under mempressure
+	 * do not use with virtual engines as this really is only needed for
+	 * kernel contexts.
 	 *
 	 * We do not hold a reference to the engine here and so have to be
 	 * very careful in what rq->engine we poke. The virtual engine is
@@ -164,7 +166,8 @@  static void i915_fence_release(struct dma_fence *fence)
 	 * know that if the rq->execution_mask is a single bit, rq->engine
 	 * can be a physical engine with the exact corresponding mask.
 	 */
-	if (is_power_of_2(rq->execution_mask) &&
+	if (!intel_engine_is_virtual(rq->engine) &&
+	    is_power_of_2(rq->execution_mask) &&
 	    !cmpxchg(&rq->engine->request_pool, NULL, rq))
 		return;