[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <cover.1759875560.git.fthain@linux-m68k.org>
Date: Wed, 08 Oct 2025 09:19:20 +1100
From: Finn Thain <fthain@...ux-m68k.org>
To: Andrii Nakryiko <andrii@...nel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Peter Zijlstra <peterz@...radead.org>,
Will Deacon <will@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Arnd Bergmann <arnd@...db.de>,
Boqun Feng <boqun.feng@...il.com>,
bpf@...r.kernel.org,
Jonathan Corbet <corbet@....net>,
Eduard Zingerman <eddyz87@...il.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Hao Luo <haoluo@...gle.com>,
John Fastabend <john.fastabend@...il.com>,
Jiri Olsa <jolsa@...nel.org>,
KP Singh <kpsingh@...nel.org>,
Lance Yang <lance.yang@...ux.dev>,
linux-arch@...r.kernel.org,
linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-m68k@...r.kernel.org,
Mark Rutland <mark.rutland@....com>,
Martin KaFai Lau <martin.lau@...ux.dev>,
Stanislav Fomichev <sdf@...ichev.me>,
Song Liu <song@...nel.org>,
Yonghong Song <yonghong.song@...ux.dev>
Subject: [RFC v3 0/5] Align atomic storage
This series adds the __aligned attribute to atomic_t and atomic64_t
definitions in include/asm-generic.
It also adds Kconfig options to enable a new runtime warning to help
reveal misaligned atomic accesses on platforms which don't trap that.
Some people might assume scalars are aligned to 4-byte boundaries, while
others might assume natural alignment. Best not to encourage such
assumptions in the documentation.
Moreover, being that locks are performance sensitive, and being that
atomic operations tend to involve further assumptions, there seems to be
room for improvement here.
Pertinent to this discussion are the section "Memory Efficiency" in
Documentation/RCU/Design/Requirements/Requirements.rst
and the section "GUARANTEES" in Documentation/memory-barriers.txt
---
Changed since v2:
- Specify natural alignment for atomic64_t.
- CONFIG_DEBUG_ATOMIC checks for natural alignment again.
- New patch to add weakened alignment check.
- New patch for explicit alignment in BFP header.
---
Finn Thain (4):
documentation: Discourage alignment assumptions
bpf: Explicitly align bpf_res_spin_lock
atomic: Specify alignment for atomic_t and atomic64_t
atomic: Add option for weaker alignment check
Peter Zijlstra (1):
atomic: Add alignment check to instrumented atomic operations
.../core-api/unaligned-memory-access.rst | 7 -------
include/asm-generic/atomic64.h | 2 +-
include/asm-generic/rqspinlock.h | 2 +-
include/linux/instrumented.h | 12 ++++++++++++
include/linux/types.h | 2 +-
kernel/bpf/rqspinlock.c | 1 -
lib/Kconfig.debug | 19 +++++++++++++++++++
7 files changed, 34 insertions(+), 11 deletions(-)
--
2.49.1
Powered by blists - more mailing lists