Messages in this thread | | | Date | Thu, 5 Sep 2013 10:53:07 -0700 | Subject | Re: [PATCH] lockref: remove cpu_relax() again | From | Linus Torvalds <> |
| |
On Thu, Sep 5, 2013 at 10:35 AM, Luck, Tony <tony.luck@intel.com> wrote: > > So Linus is right that the cpu_relax() makes things less fair ... but without it performance sucks so > much that I don't want to use the clever cmpxchg at all - I'm much better off without it!
Hmm. Is this single-socket? The thing really only is supposed to help if there's tons of contention.
Also, it strikes me that ia64 has tons of different versions of cmpxchg, and the one you use by default is the one with "acquire" semantics. That may well be the right thing to do, but I have this possibly unfounded gut feeling that you might want to try using a relaxed cmpxchg and then perhaps have a memory barrier *after* it has successfully executed.
I'll have to think a bit more about what the exact memory ordering requirements for lockref's are, but my gut feel is that just for incrementing the reference count you don't actually have any real memory ordering requirements.
Linus
| |