[Intel-gfx] [PATCH] drm/i915: Use per-engine request pools

Chris Wilson chris at chris-wilson.co.uk
Thu Apr 2 12:11:44 UTC 2020


Quoting Chris Wilson (2020-04-02 12:59:08)
> Add a per-engine request mempool so that we should always have a couple
> of requests available for powermanagement allocations from tricky
> contexts. These reserves are expected to be only used for kernel
> contexts when barriers must be emitted [almost] without fail.
> 
> When using the mempool, requests are first allocated from the global
> slab cache (utilising all the per-cpu lockless freelists and caches) and
> only if that is empty and cannot be filled under the gfp_t do we
> fallback to using the per-engine cache of recently freed requests. For
> our use cases, this will never be empty for long as there will always be
> at least the previous powermanagent request to reuse.
> 
> The downside is that this is quite a bulky addition and abstraction to
> use, but it will ensure that we never fail to park the engine due to
> oom.

Strictly speaking, mempool_alloc() does not have the semantics I ascribe
it. Which is annoying.

mempool_alloc() will always dip into the reserves if a NORETRY alloc
fails, and so we should ourselves reserve dipping into the mempool if we
can.
-Chris


More information about the Intel-gfx mailing list