Re: [PATCH] lockref: stop doing cpu_relax in the cmpxchg loop

2023-01-13 Thread Linus Torvalds
On Fri, Jan 13, 2023 at 3:47 PM Luck, Tony wrote: > > The computer necrophiliacs at Debian and Gentoo seem determined > to keep ia64 alive. > > So perhaps this should s/cpu_relax/soemt_relax/ where soemt_relax > is a no-op everywhere except ia64, which can define it as cpu_relax. Heh. I already t

[PATCH] lockref: stop doing cpu_relax in the cmpxchg loop

2023-01-13 Thread Mateusz Guzik
On the x86-64 architecture even a failing cmpxchg grants exclusive access to the cacheline, making it preferable to retry the failed op immediately instead of stalling with the pause instruction. To illustrate the impact, below are benchmark results obtained by running various will-it-scale tests

RE: [PATCH] lockref: stop doing cpu_relax in the cmpxchg loop

2023-01-13 Thread Luck, Tony
> diff --git a/lib/lockref.c b/lib/lockref.c > index 45e93ece8ba0..2afe4c5d8919 100644 > --- a/lib/lockref.c > +++ b/lib/lockref.c > @@ -23,7 +23,6 @@ > } > \ > if (!--retry)