drm: Micro-optimise drm_mm_for_each_node_in_range()
authorChris Wilson <chris@chris-wilson.co.uk>
Sat, 4 Feb 2017 11:19:13 +0000 (11:19 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 6 Feb 2017 15:57:37 +0000 (16:57 +0100)
commitbbba96931762bcad8a691dfbf8d1520b71831c3a
treef3e4eaf765b4b1dcb1207a30532e40f6478e5117
parentc5a828148f302c72a137af7f5487a4e52f19f4c9
drm: Micro-optimise drm_mm_for_each_node_in_range()

As we require valid start/end parameters, we can replace the initial
potential NULL with a pointer to the drm_mm.head_node and so reduce the
test on every iteration from a NULL + address comparison to just an
address comparison.

add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-26 (-26)
function                                     old     new   delta
i915_gem_evict_for_node                      719     693     -26

(No other users outside of the test harness.)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20170204111913.12416-1-chris@chris-wilson.co.uk
drivers/gpu/drm/drm_mm.c
drivers/gpu/drm/selftests/test-drm_mm.c
include/drm/drm_mm.h