Re: [PATCH] x86/mm: re-implement get_page_light() using an atomic increment

2024-03-04 Thread Jan Beulich
On 04.03.2024 09:50, Roger Pau Monné wrote: > On Mon, Mar 04, 2024 at 08:54:34AM +0100, Jan Beulich wrote: >> On 01.03.2024 13:42, Roger Pau Monne wrote: >>> The current usage of a cmpxchg loop to increase the value of page count is >>> not >>> optimal on amd64, as there's already an instruction t

Re: [PATCH] x86/mm: re-implement get_page_light() using an atomic increment

2024-03-04 Thread Roger Pau Monné
On Mon, Mar 04, 2024 at 08:54:34AM +0100, Jan Beulich wrote: > On 01.03.2024 13:42, Roger Pau Monne wrote: > > The current usage of a cmpxchg loop to increase the value of page count is > > not > > optimal on amd64, as there's already an instruction to do an atomic add to a > > 64bit integer. > >

Re: [PATCH] x86/mm: re-implement get_page_light() using an atomic increment

2024-03-03 Thread Jan Beulich
On 01.03.2024 13:42, Roger Pau Monne wrote: > The current usage of a cmpxchg loop to increase the value of page count is not > optimal on amd64, as there's already an instruction to do an atomic add to a > 64bit integer. > > Switch the code in get_page_light() to use an atomic increment, as that a

Re: [PATCH] x86/mm: re-implement get_page_light() using an atomic increment

2024-03-01 Thread Andrew Cooper
On 01/03/2024 12:42 pm, Roger Pau Monne wrote: > The current usage of a cmpxchg loop to increase the value of page count is not > optimal on amd64, as there's already an instruction to do an atomic add to a > 64bit integer. > > Switch the code in get_page_light() to use an atomic increment, as that

[PATCH] x86/mm: re-implement get_page_light() using an atomic increment

2024-03-01 Thread Roger Pau Monne
The current usage of a cmpxchg loop to increase the value of page count is not optimal on amd64, as there's already an instruction to do an atomic add to a 64bit integer. Switch the code in get_page_light() to use an atomic increment, as that avoids a loop construct. This slightly changes the ord