drm/i915: Convert execbuf to use struct-of-array packing for critical fields
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 16 Aug 2017 08:52:06 +0000 (09:52 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 18 Aug 2017 10:57:36 +0000 (11:57 +0100)
commitc7c6e46f913bb3a6ff19e64940ebb54652033677
tree6da86f21d43db7debd99d0444551604dd4ad678e
parent8bcbfb12818f811d63801b71d25809690d1798fc
drm/i915: Convert execbuf to use struct-of-array packing for critical fields

When userspace is doing most of the work, avoiding relocs (using
NO_RELOC) and opting out of implicit synchronisation (using ASYNC), we
still spend a lot of time processing the arrays in execbuf, even though
we now should have nothing to do most of the time. One issue that
becomes readily apparent in profiling anv is that iterating over the
large execobj[] is unfriendly to the loop prefetchers of the CPU and it
much prefers iterating over a pair of arrays rather than one big array.

v2: Clear vma[] on construction to handle errors during vma lookup

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170816085210.4199-3-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem_evict.c
drivers/gpu/drm/i915/i915_gem_execbuffer.c
drivers/gpu/drm/i915/i915_vma.h