[Intel-gfx] [PATCH 07/13] drm/i915: Introduce dedicated object VMA iterator

Daniel Vetter daniel at ffwll.ch
Mon Jan 11 00:48:22 PST 2016


On Fri, Jan 08, 2016 at 11:44:04AM +0000, Chris Wilson wrote:
> On Fri, Jan 08, 2016 at 11:29:46AM +0000, Tvrtko Ursulin wrote:
> > From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> > 
> > Purpose is to catch places which iterate the object VMA list
> > without holding the big lock.
> > 
> > Implemented by open coding list_for_each_entry to make the
> > macro compatible with existing call sites.
> > 
> > Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> > Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> > +#define i915_gem_obj_for_each_vma(vma, obj) \
> > +	for (WARN_ON_ONCE(!mutex_is_locked(&(obj)->base.dev->struct_mutex)), \
> 
> Let's not go around adding WARN(!mutex_locked) to GEM code when
> lockdep_assert_held doesn't add overhead outside of testing.

Hm yeah I still prefere WARN_ON for modeset code (where it doesn't matter)
because of increased test coverage. But for gem it indeed makes more sense
to only do this for lockdep-enabled builds. CI runs with lockdep, so we're
good.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list