diff options
| author | Uros Bizjak <[email protected]> | 2023-07-03 15:00:59 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2023-08-09 22:08:51 +0000 |
| commit | 9e761bff03e137fca0c41fd3bcc3e88167d59dc1 (patch) | |
| tree | 3022d4c81133a842ca8ef7838240a0ff3d4d61bb /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | |
| parent | drm/amdgpu: Add pci usage to nbio v7.9 (diff) | |
| download | kernel-9e761bff03e137fca0c41fd3bcc3e88167d59dc1.tar.gz kernel-9e761bff03e137fca0c41fd3bcc3e88167d59dc1.zip | |
drm/amdgpu: Use local64_try_cmpxchg in amdgpu_perf_read
Use local64_try_cmpxchg instead of local64_cmpxchg (*ptr, old, new) == old
in amdgpu_perf_read. x86 CMPXCHG instruction returns success in ZF flag,
so this change saves a compare after cmpxchg (and related move instruction
in front of cmpxchg).
Also, try_cmpxchg implicitly assigns old *ptr value to "old" when cmpxchg
fails. There is no need to re-read the value in the loop.
No functional change intended.
Cc: Alex Deucher <[email protected]>
Cc: "Christian König" <[email protected]>
Cc: "Pan, Xinhui" <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Signed-off-by: Uros Bizjak <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
0 files changed, 0 insertions, 0 deletions
