[Intel-gfx] [PATCH 2/2] drm/i915: Remove the global cache shrink & rcu barrier on allocation failure

Chris Wilson chris at chris-wilson.co.uk
Fri Oct 5 09:16:35 UTC 2018


Quoting Tvrtko Ursulin (2018-10-05 09:39:45)
> 
> On 05/10/2018 09:03, Chris Wilson wrote:
> > Earlier, we reasoned that having idled the gpu under mempressure, that
> > would be a good time to trim our request slabs in order to perform the
> > next request allocation. We have stopped performing the global operation
> > on the device (no idling) and wish to make the allocation failure
> > handling more local, so out with the global barrier that may take a long
> > time.
> > 
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> > ---
> >   drivers/gpu/drm/i915/i915_request.c | 11 -----------
> >   1 file changed, 11 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
> > index 32bf2c9868bf..c5e40e5f0e65 100644
> > --- a/drivers/gpu/drm/i915/i915_request.c
> > +++ b/drivers/gpu/drm/i915/i915_request.c
> > @@ -657,17 +657,6 @@ i915_request_alloc(struct intel_engine_cs *engine, struct i915_gem_context *ctx)
> >               if (rq)
> >                       cond_synchronize_rcu(rq->rcustate);
> >   
> > -             /*
> > -              * We've forced the client to stall and catch up with whatever
> > -              * backlog there might have been. As we are assuming that we
> > -              * caused the mempressure, now is an opportune time to
> > -              * recover as much memory from the request pool as is possible.
> > -              * Having already penalized the client to stall, we spend
> > -              * a little extra time to re-optimise page allocation.
> > -              */
> > -             kmem_cache_shrink(i915->requests);
> > -             rcu_barrier(); /* Recover the TYPESAFE_BY_RCU pages */
> > -
> >               rq = kmem_cache_alloc(i915->requests, GFP_KERNEL);
> >               if (!rq) {
> >                       ret = -ENOMEM;
> > 
> 
> Wish I was in space...
> .
> .
> .
> .
> ...so no one could hear me scream! :))

I did say I was going to phase it out. I still suspect we need a
cond_synchronize_rcu_expedited(), and the kmem_cache_alloc() may itself
stall for umpteen seconds. But I hope never for igt.
-Chris


More information about the Intel-gfx mailing list