[Intel-gfx] [PATCH V2 6/6] drm/i915:Use the coarse ping-pong mechanism based on drm fd to dispatch the BSD command on BDW GT3

Chris Wilson chris at chris-wilson.co.uk
Mon Apr 14 10:19:22 CEST 2014


On Mon, Apr 14, 2014 at 04:05:19PM +0800, Zhao Yakui wrote:
> On Mon, 2014-04-14 at 01:22 -0600, Daniel Vetter wrote:
> > You're still using atomic_t for no real good reason.
> > gen8_dispatch_bsd_ring is always called with the dev->struct_mutex lock
> > held, so there's really no reason for it.
> 
> If the struct_mutex is used in the gen8_dispatch_bsd_ring, I can remove
> the atomic_t. 
> It seems that the struct_mutex is a big lock and it is used very
> frequently(i915_gem.c, i915_dma.c and so on). In my point it is a little
> heavier than the atomic_t if one counter is increased and returned. 
> 
> If you think that the mutex is better than atomic, I will follow your
> advice.

You are already holding the struct_mutex whenever we touch the ring and
execbuffer. Even in a fine-grained world, there will still be a mutex
around all operations that touch the rings.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list