Re: [PATCH] x86/hyperv: Use atomic_try_cmpxchg() to micro-optimize hv_nmi_unknown()

2023-11-22 Thread Konstantin Ryabitsev
November 21, 2023 at 10:51 PM, "Wei Liu" wrote: > Uros, just so you know, DKIM verification failed when I used b4 to apply > this patch. You may want to check your email setup. This is not actually Uros's fault. Recently, Gmail started adding a forced expiration field to their DKIM signatures,

Re: [PATCH] x86/hyperv: Use atomic_try_cmpxchg() to micro-optimize hv_nmi_unknown()

2023-11-22 Thread Uros Bizjak
On Wed, Nov 22, 2023 at 1:31 PM Uros Bizjak wrote: > > On Wed, Nov 22, 2023 at 4:52 AM Wei Liu wrote: > > > > On Wed, Nov 15, 2023 at 09:58:29PM +0100, Uros Bizjak wrote: > > > On Wed, Nov 15, 2023 at 6:19 PM Michael Kelley > > > wrote: > > > > > > > > From: Uros Bizjak Sent: Tuesday,

Re: [PATCH] x86/hyperv: Use atomic_try_cmpxchg() to micro-optimize hv_nmi_unknown()

2023-11-22 Thread Uros Bizjak
On Wed, Nov 22, 2023 at 4:52 AM Wei Liu wrote: > > On Wed, Nov 15, 2023 at 09:58:29PM +0100, Uros Bizjak wrote: > > On Wed, Nov 15, 2023 at 6:19 PM Michael Kelley wrote: > > > > > > From: Uros Bizjak Sent: Tuesday, November 14, 2023 > > > 8:59 AM > > > > > > > > Use atomic_try_cmpxchg()

Re: [PATCH] x86/hyperv: Use atomic_try_cmpxchg() to micro-optimize hv_nmi_unknown()

2023-11-21 Thread Wei Liu
On Wed, Nov 15, 2023 at 09:58:29PM +0100, Uros Bizjak wrote: > On Wed, Nov 15, 2023 at 6:19 PM Michael Kelley wrote: > > > > From: Uros Bizjak Sent: Tuesday, November 14, 2023 8:59 > > AM > > > > > > Use atomic_try_cmpxchg() instead of atomic_cmpxchg(*ptr, old, new) == old > > > in

Re: [PATCH] x86/hyperv: Use atomic_try_cmpxchg() to micro-optimize hv_nmi_unknown()

2023-11-15 Thread Uros Bizjak
On Wed, Nov 15, 2023 at 6:19 PM Michael Kelley wrote: > > From: Uros Bizjak Sent: Tuesday, November 14, 2023 8:59 AM > > > > Use atomic_try_cmpxchg() instead of atomic_cmpxchg(*ptr, old, new) == old > > in hv_nmi_unknown(). On x86 the CMPXCHG instruction returns success in > > the ZF flag, so

RE: [PATCH] x86/hyperv: Use atomic_try_cmpxchg() to micro-optimize hv_nmi_unknown()

2023-11-15 Thread Michael Kelley
From: Uros Bizjak Sent: Tuesday, November 14, 2023 8:59 AM > > Use atomic_try_cmpxchg() instead of atomic_cmpxchg(*ptr, old, new) == old > in hv_nmi_unknown(). On x86 the CMPXCHG instruction returns success in > the ZF flag, so this change saves a compare after CMPXCHG. The generated > asm code