[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YUhwHsx8n0KJWgQP@hirez.programming.kicks-ass.net>
Date: Mon, 20 Sep 2021 13:27:26 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
the arch/x86 maintainers <x86@...nel.org>
Subject: Re: [GIT pull] locking/urgent for v5.15-rc2
On Sun, Sep 19, 2021 at 01:10:45PM -0700, Linus Torvalds wrote:
> On Sun, Sep 19, 2021 at 11:28 AM Thomas Gleixner <tglx@...utronix.de> wrote:
> >
> >
> > - atomic_add(READER_BIAS - bias, &rwb->readers);
> > + /*
> > + * _release() is needed in case that reader is in fast path, pairing
> > + * with atomic_try_cmpxchg() in rwbase_read_trylock(), provides RELEASE
> > + */
> > + (void)atomic_add_return_release(READER_BIAS - bias, &rwb->readers);
>
> Ugh. This really needs fixing.
>
> atomic_add() is already much more than release-ordered on x86, and
> atomic_add_return_release() is much more expensive on some uarchs.
Is that XADD really more expensive? I don't think I've ever seen that.
Anyway, sure, we can go create atomic_{add,sub}_release() and replace
the few occurences we have of this (a quick grep shows this is the 3rd
such).
Powered by blists - more mailing lists