]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Use seqlock in engine stats
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Thu, 26 Apr 2018 07:47:16 +0000 (08:47 +0100)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Thu, 26 Apr 2018 09:10:05 +0000 (10:10 +0100)
commit217e51e7283c62b9a85a3ba6ee5e8a3bc6c396c0
treed38e3e74c075e4b22ba012f383e1bfc4ed924cd7
parent533df72ff7a98a10209ed11c920c3f4c755a86f3
drm/i915: Use seqlock in engine stats

We can convert engine stats from a spinlock to seqlock to ensure interrupt
processing is never even a tiny bit delayed by parallel readers.

There is a smidgen bit more cost on the write lock side, and an extremely
unlikely chance that readers will have to retry a few times in face of
heavy interrupt load. But it should be extremely unlikely given how
lightweight read side section is compared to the interrupt processing
side, and also compared to the rest of the code paths which can lead into
it. Furthermore, writer is the ones doing the real, latency sensitive
work, while readers are only informative.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20180426074716.7352-1-tvrtko.ursulin@linux.intel.com
drivers/gpu/drm/i915/intel_engine_cs.c
drivers/gpu/drm/i915/intel_ringbuffer.h