summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_lrc.c
diff options
context:
space:
mode:
authorChris Wilson2017-05-17 14:10:04 +0200
committerChris Wilson2017-05-17 14:38:12 +0200
commitc5cf9a9147ff6fc9f87251a8f8a5b6ac8b8bdcdc (patch)
tree702c41615fc385f7bef80a5c7e564cbb8d343705 /drivers/gpu/drm/i915/intel_lrc.c
parentdrm/i915: Split execlist priority queue into rbtree + linked list (diff)
downloadkernel-qcow2-linux-c5cf9a9147ff6fc9f87251a8f8a5b6ac8b8bdcdc.tar.gz
kernel-qcow2-linux-c5cf9a9147ff6fc9f87251a8f8a5b6ac8b8bdcdc.tar.xz
kernel-qcow2-linux-c5cf9a9147ff6fc9f87251a8f8a5b6ac8b8bdcdc.zip
drm/i915: Create a kmem_cache to allocate struct i915_priolist from
The i915_priolist are allocated within an atomic context on a path where we wish to minimise latency. If we use a dedicated kmem_cache, we have the advantage of a local freelist from which to service new requests that should keep the latency impact of an allocation small. Though currently we expect the majority of requests to be at default priority (and so hit the preallocate priolist), once userspace starts using priorities they are likely to use many fine grained policies improving the utilisation of a private slab. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170517121007.27224-9-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lrc.c')
-rw-r--r--drivers/gpu/drm/i915/intel_lrc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 626db6185a21..8529746dd7cc 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -499,7 +499,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
rb_erase(&p->node, &engine->execlist_queue);
INIT_LIST_HEAD(&p->requests);
if (p->priority != I915_PRIORITY_NORMAL)
- kfree(p);
+ kmem_cache_free(engine->i915->priorities, p);
}
done:
engine->execlist_first = rb;
@@ -661,7 +661,7 @@ find_priolist:
if (prio == I915_PRIORITY_NORMAL) {
p = &engine->default_priolist;
} else {
- p = kmalloc(sizeof(*p), GFP_ATOMIC);
+ p = kmem_cache_alloc(engine->i915->priorities, GFP_ATOMIC);
/* Convert an allocation failure to a priority bump */
if (unlikely(!p)) {
prio = I915_PRIORITY_NORMAL; /* recurses just once */