[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHirt9j+UJiNpgmeSOMnUnYomOLgi1oD44ZCzEWA9OAzrnAMaw@mail.gmail.com>
Date: Thu, 29 Jul 2021 18:58:59 +0800
From: hev <r@....cc>
To: Will Deacon <will@...nel.org>
Cc: Rui Wang <wangrui@...ngson.cn>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>, Arnd Bergmann <arnd@...db.de>,
Waiman Long <longman@...hat.com>,
Boqun Feng <boqun.feng@...il.com>, Guo Ren <guoren@...nel.org>,
linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org,
Xuefeng Li <lixuefeng@...ngson.cn>,
Huacai Chen <chenhuacai@...il.com>,
Jiaxun Yang <jiaxun.yang@...goat.com>,
Huacai Chen <chenhuacai@...ngson.cn>,
kernel test robot <lkp@...el.com>
Subject: Re: [RFC PATCH v3] locking/atomic: Implement atomic{,64,_long}_{fetch_,}{andnot_or}{,_relaxed,_acquire,_release}()
Hi, Will,
On Thu, Jul 29, 2021 at 5:55 PM Will Deacon <will@...nel.org> wrote:
>
> On Thu, Jul 29, 2021 at 05:30:03PM +0800, Rui Wang wrote:
> > This patch introduce a new atomic primitive andnot_or:
> >
> > * atomic_andnot_or
> > * atomic_fetch_andnot_or
> > * atomic_fetch_andnot_or_relaxed
> > * atomic_fetch_andnot_or_acquire
> > * atomic_fetch_andnot_or_release
> > * atomic64_andnot_or
> > * atomic64_fetch_andnot_or
> > * atomic64_fetch_andnot_or_relaxed
> > * atomic64_fetch_andnot_or_acquire
> > * atomic64_fetch_andnot_or_release
> > * atomic_long_andnot_or
> > * atomic_long_fetch_andnot_or
> > * atomic_long_fetch_andnot_or_relaxed
> > * atomic_long_fetch_andnot_or_acquire
> > * atomic_long_fetch_andnot_or_release
> >
> > Reported-by: kernel test robot <lkp@...el.com>
> > Signed-off-by: Rui Wang <wangrui@...ngson.cn>
> > ---
> > include/asm-generic/atomic-instrumented.h | 72 +++++-
> > include/asm-generic/atomic-long.h | 62 ++++-
> > include/linux/atomic-arch-fallback.h | 262 +++++++++++++++++++++-
> > lib/atomic64_test.c | 92 ++++----
> > scripts/atomic/atomics.tbl | 1 +
> > scripts/atomic/fallbacks/andnot_or | 25 +++
> > 6 files changed, 471 insertions(+), 43 deletions(-)
> > create mode 100755 scripts/atomic/fallbacks/andnot_or
>
> Please see my other comments on the other patches you posted:
>
> https://lore.kernel.org/r/20210729093923.GD21151@willie-the-truck
>
> Overall, I'm not thrilled to bits by extending the atomics API with
> operations that cannot be implemented efficiently on any (?) architectures
> and are only used by the qspinlock slowpath on machines with more than 16K
> CPUs.
>
> I also think we're lacking documentation justifying when you would use this
> new primitive over e.g. a sub-word WRITE_ONCE() on architectures that
> support those, especially for the non-returning variants.
>
> Will
I have tried to explain in another thread. At the beginning, I thought
about implementing xchg_mask for the sub-word xchg, but now I agree
that atomic andnot_or is clearer and more general.
Peter, what do you think?
Regards,
Rui
Powered by blists - more mailing lists