drm/i915: Do interrupible mutex lock first to avoid locking for unreference
authorChris Wilson <chris@chris-wilson.co.uk>
Sun, 17 Oct 2010 08:45:41 +0000 (09:45 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 19 Oct 2010 08:20:23 +0000 (09:20 +0100)
commit1d7cfea152cae6159aa30ceae38c3eaf13ea083c
treef9d8b2536555c3a5af75d461f16d7374af988cf8
parent139d363bcf2d995a72694ddd2b8665af6cb7fb54
drm/i915: Do interrupible mutex lock first to avoid locking for unreference

One of the primarily consumers of the i915 driver is X, a large signal
driven application. Frequently when writing into the buffers, there is a
pending signal which causes us not to take the interruptible lock but
then we need to take that same lock around the object unreference. By
rearranging the code to do the interruptible lock as the first check, we
can avoid the frequent additional locking around the unreference.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/i915_gem.c