diff options
| author | Will Deacon <[email protected]> | 2017-10-12 12:20:49 +0000 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2017-10-25 08:57:24 +0000 |
| commit | b519b56e378ee82caf9b079b04f5db87dedc3251 (patch) | |
| tree | 82dddca8c324c5a32ef4a41945f625868ff7a03a /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | |
| parent | locking/atomic: Add atomic_cond_read_acquire() (diff) | |
| download | kernel-b519b56e378ee82caf9b079b04f5db87dedc3251.tar.gz kernel-b519b56e378ee82caf9b079b04f5db87dedc3251.zip | |
locking/qrwlock: Use atomic_cond_read_acquire() when spinning in qrwlock
The qrwlock slowpaths involve spinning when either a prospective reader
is waiting for a concurrent writer to drain, or a prospective writer is
waiting for concurrent readers to drain. In both of these situations,
atomic_cond_read_acquire() can be used to avoid busy-waiting and make use
of any backoff functionality provided by the architecture.
This patch replaces the open-code loops and rspin_until_writer_unlock()
implementation with atomic_cond_read_acquire(). The write mode transition
zero to _QW_WAITING is left alone, since (a) this doesn't need acquire
semantics and (b) should be fast.
Tested-by: Waiman Long <[email protected]>
Tested-by: Jeremy Linton <[email protected]>
Tested-by: Adam Wallis <[email protected]>
Tested-by: Jan Glauber <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
Acked-by: Peter Zijlstra <[email protected]>
Cc: Boqun Feng <[email protected]>
Cc: [email protected]
Cc: Linus Torvalds <[email protected]>
Cc: Paul E. McKenney <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
0 files changed, 0 insertions, 0 deletions
