Re: [PATCH 2/2] x86/hpet: use an atomic add instead of a cmpxchg loop

2024-02-26 Thread Jan Beulich
On 22.02.2024 10:05, Roger Pau Monne wrote: > The usage of a cmpxchg loop in hpet_get_channel() is unnecessary, as the same > can be achieved with an atomic increment, which is both simpler to read, and > avoid any need for a loop. > > Note there can be a small divergence in the channel returned

Re: [PATCH 2/2] x86/hpet: use an atomic add instead of a cmpxchg loop

2024-02-22 Thread Julien Grall
Hi Roger, On 22/02/2024 09:05, Roger Pau Monne wrote: The usage of a cmpxchg loop in hpet_get_channel() is unnecessary, as the same can be achieved with an atomic increment, which is both simpler to read, and avoid any need for a loop. Note there can be a small divergence in the channel

Re: [PATCH 2/2] x86/hpet: use an atomic add instead of a cmpxchg loop

2024-02-22 Thread Jan Beulich
On 22.02.2024 11:58, Roger Pau Monné wrote: > On Thu, Feb 22, 2024 at 11:10:54AM +0100, Jan Beulich wrote: >> On 22.02.2024 10:05, Roger Pau Monne wrote: >>> The usage of a cmpxchg loop in hpet_get_channel() is unnecessary, as the >>> same >>> can be achieved with an atomic increment, which is

Re: [PATCH 2/2] x86/hpet: use an atomic add instead of a cmpxchg loop

2024-02-22 Thread Roger Pau Monné
On Thu, Feb 22, 2024 at 11:10:54AM +0100, Jan Beulich wrote: > On 22.02.2024 10:05, Roger Pau Monne wrote: > > The usage of a cmpxchg loop in hpet_get_channel() is unnecessary, as the > > same > > can be achieved with an atomic increment, which is both simpler to read, and > > avoid any need for

Re: [PATCH 2/2] x86/hpet: use an atomic add instead of a cmpxchg loop

2024-02-22 Thread Jan Beulich
On 22.02.2024 10:05, Roger Pau Monne wrote: > The usage of a cmpxchg loop in hpet_get_channel() is unnecessary, as the same > can be achieved with an atomic increment, which is both simpler to read, and > avoid any need for a loop. > > Note there can be a small divergence in the channel returned

[PATCH 2/2] x86/hpet: use an atomic add instead of a cmpxchg loop

2024-02-22 Thread Roger Pau Monne
The usage of a cmpxchg loop in hpet_get_channel() is unnecessary, as the same can be achieved with an atomic increment, which is both simpler to read, and avoid any need for a loop. Note there can be a small divergence in the channel returned if next_channel overflows, but returned channel will