]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Cache last obj->pages location for i915_gem_object_get_page()
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 7 Apr 2015 15:20:25 +0000 (16:20 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 10 Apr 2015 06:56:00 +0000 (08:56 +0200)
commit8326271aa12b25f2360f3d2ed34638aecdf8d021
tree32eccf74ef6c7e0446244f9042d5512a2288a2ac
parent91f8f090ab06309841cb89566d37e15535b6c524
drm/i915: Cache last obj->pages location for i915_gem_object_get_page()

The biggest user of i915_gem_object_get_page() is the relocation
processing during execbuffer. Typically userspace passes in a set of
relocations in sorted order. Sadly, we alternate between relocations
increasing from the start of the buffers, and relocations decreasing
from the end. However the majority of consecutive lookups will still be
in the same page. We could cache the start of the last sg chain, however
for most callers, the entire sgl is inside a single chain and so we see
no improve from the extra layer of caching.

v2: Avoid the double increment inside unlikely()

References: https://bugs.freedesktop.org/show_bug.cgi?id=88308
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: John Harrison <John.C.Harrison@Intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c