Skip to contentSkip to conversation

bpf-explicitly-align-bpf_res_spin_lock.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Jan 21

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: bpf: explicitly align bpf_res_spin_lock
has been removed from the -mm tree. Its filename was
bpf-explicitly-align-bpf_res_spin_lock.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Finn Thain <[email protected]>
Subject: bpf: explicitly align bpf_res_spin_lock
Date: Tue, 13 Jan 2026 16:22:28 +1100

Patch series "Align atomic storage", v7.

This series adds the __aligned attribute to atomic_t and atomic64_t definitions in include/linux and include/asm-generic (respectively) to get natural alignment of both types on csky, m68k, microblaze, nios2, openrisc and sh.

This series also adds Kconfig options to enable a new run-time warning to help reveal misaligned atomic accesses on platforms which don't trap that.

The performance impact is expected to vary across platforms and workloads. The measurements I made on m68k show that some workloads run faster and others slower.

This patch (of 4):

Align bpf_res_spin_lock to avoid a BUILD_BUG_ON() when the alignment changes, as it will do on m68k when, in a subsequent patch, the minimum alignment of the atomic_t member of struct rqspinlock gets increased from 2 to 4. Drop the BUILD_BUG_ON() as it becomes redundant.

Cc Geert Uytterhoeven <[email protected]>
Cc Andrii Nakryiko <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Boqun Feng <[email protected]>
Cc "Borislav Petkov (AMD)" <[email protected]>
Cc Daniel Borkman <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Eduard Zingerman <[email protected]>
Cc Gary Guo <[email protected]>
Cc Guo Ren <[email protected]>
Cc Hao Luo <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc John Fastabend <[email protected]>
Cc John Paul Adrian Glaubitz <[email protected]>
Cc Jonas Bonn <[email protected]>
Cc KP Singh <[email protected]>
Cc Marc Rutland <[email protected]>
Cc Martin KaFai Lau <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Rich Felker <[email protected]>
Cc Sasha Levin (Microsoft) <[email protected]>
Cc Song Liu <[email protected]>
Cc Stafford Horne <[email protected]>
Cc Stanislav Fomichev <[email protected]>
Cc Stefan Kristiansson <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Will Deacon <[email protected]>
Cc Yonghong Song <[email protected]>
Cc Yoshinori Sato <[email protected]>
Cc Dave Hansen <[email protected]>

---

 include/asm-generic/rqspinlock.h |    2 +-
 kernel/bpf/rqspinlock.c          |    1 -
 2 files changed, 1 insertion(+), 2 deletions(-)
include/asm-generic/rqspinlock.h renamed from include/asm-generic/rqspinlock.h~bpf-explicitly-align-bpf_res_spin_lock +1 -1
@@ -28,7 +28,7 @@ struct rqspinlock {
  */
 struct bpf_res_spin_lock {
 	u32 val;
-};
+} __aligned(__alignof__(struct rqspinlock));
 
 struct qspinlock;
 #ifdef CONFIG_QUEUED_SPINLOCKS
kernel/bpf/rqspinlock.c renamed from kernel/bpf/rqspinlock.c~bpf-explicitly-align-bpf_res_spin_lock +0 -1
@@ -694,7 +694,6 @@ __bpf_kfunc int bpf_res_spin_lock(struct
 	int ret;
 
 	BUILD_BUG_ON(sizeof(rqspinlock_t) != sizeof(struct bpf_res_spin_lock));
-	BUILD_BUG_ON(__alignof__(rqspinlock_t) != __alignof__(struct bpf_res_spin_lock));
 
 	preempt_disable();
 	ret = res_spin_lock((rqspinlock_t *)lock);

_

Patches currently in -mm which might be from [email protected] are