Re: [Intel-gfx] [PATCH 12/16] drm/i915: Reduce locking inside swfinish ioctl

2016-08-04 Thread Chris Wilson
On Thu, Aug 04, 2016 at 01:32:52PM +0300, Joonas Lahtinen wrote: > On ma, 2016-08-01 at 19:22 +0100, Chris Wilson wrote: > >   /* Pinned buffers may be scanout, so flush the cache */ > > - if (obj->pin_display) > > + if (READ_ONCE(obj->pin_display)) { > > + ret =

Re: [Intel-gfx] [PATCH 12/16] drm/i915: Reduce locking inside swfinish ioctl

2016-08-04 Thread Joonas Lahtinen
On ma, 2016-08-01 at 19:22 +0100, Chris Wilson wrote: >   /* Pinned buffers may be scanout, so flush the cache */ > - if (obj->pin_display) > + if (READ_ONCE(obj->pin_display)) { > + ret = i915_mutex_lock_interruptible(dev); > + if (ret) > +

[Intel-gfx] [PATCH 12/16] drm/i915: Reduce locking inside swfinish ioctl

2016-08-01 Thread Chris Wilson
We only need to take the struct_mutex if the object is pinned to the display engine and so requires checking for clflush. (The race with userspace pinning the object to a framebuffer is irrelevant.) v2: Use access once for compiler hints (or not as it is a bitfield) v3: READ_ONCE,