Message ID | 20230126151323.643408110@infradead.org (mailing list archive) |
---|---|
State | Accepted |
Commit | 5c9da9fe826d4a0d84bb322cca27cc8ad8d23b24 |
Headers | show |
Series | A few more cpuidle vs rcu fixes | expand |
diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c index eda37df016f0..5a2a517dd61b 100644 --- a/arch/x86/kernel/pvclock.c +++ b/arch/x86/kernel/pvclock.c @@ -102,10 +102,9 @@ u64 pvclock_clocksource_read(struct pvclock_vcpu_time_info *src) */ last = atomic64_read(&last_value); do { - if (ret < last) + if (ret <= last) return last; - last = atomic64_cmpxchg(&last_value, last, ret); - } while (unlikely(last != ret)); + } while (!atomic64_try_cmpxchg(&last_value, &last, ret)); return ret; }