lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210729095551.GE21151@willie-the-truck>
Date:   Thu, 29 Jul 2021 10:55:52 +0100
From:   Will Deacon <will@...nel.org>
To:     Rui Wang <wangrui@...ngson.cn>
Cc:     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,
        Rui Wang <r@....cc>, 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}()

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ