Re: [PATCH] dmaengine:idxd: Use local64_try_cmpxchg in perfmon_pmu_event_update

From: Vinod Koul
Date: Tue Aug 01 2023 - 14:45:33 EST



On Mon, 03 Jul 2023 16:52:37 +0200, Uros Bizjak wrote:
> Use local64_try_cmpxchg instead of local64_cmpxchg (*ptr, old, new) == old
> in perfmon_pmu_event_update. 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.
>
> [...]

Applied, thanks!

[1/1] dmaengine:idxd: Use local64_try_cmpxchg in perfmon_pmu_event_update
commit: cae701b9ccf128edea26982f73178087fc3ad180

Best regards,
--
~Vinod