diff options
author | Uros Bizjak <[email protected]> | 2023-01-26 16:08:35 +0100 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2023-01-31 15:01:46 +0100 |
commit | 5c9da9fe826d4a0d84bb322cca27cc8ad8d23b24 (patch) | |
tree | 40d9cd963fc5af7264ff8d6386304b350c8ddfbe /scripts/gdb/linux/proc.py | |
parent | 7aab7aa4b4bed2b9030fcdd207e0f3a5d257bda0 (diff) |
x86/pvclock: Improve atomic update of last_value in pvclock_clocksource_read()
Improve atomic update of last_value in pvclock_clocksource_read:
- Atomic update can be skipped if the "last_value" is already
equal to "ret".
- The detection of atomic update failure is not correct. The value,
returned by atomic64_cmpxchg should be compared to the old value
from the location to be updated. If these two are the same, then
atomic update succeeded and "last_value" location is updated to
"ret" in an atomic way. Otherwise, the atomic update failed and
it should be retried with the value from "last_value" - exactly
what atomic64_try_cmpxchg does in a correct and more optimal way.
Signed-off-by: Uros Bizjak <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'scripts/gdb/linux/proc.py')
0 files changed, 0 insertions, 0 deletions