Skip to contentSkip to conversation

atomic-add-option-for-weaker-alignment-check.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: atomic: add option for weaker alignment check
has been removed from the -mm tree. Its filename was
atomic-add-option-for-weaker-alignment-check.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: atomic: add option for weaker alignment check
Date: Tue, 13 Jan 2026 16:22:28 +1100

Add a new Kconfig symbol to make CONFIG_DEBUG_ATOMIC more useful on those architectures which do not align dynamic allocations to 8-byte boundaries. Without this, CONFIG_DEBUG_ATOMIC produces excessive WARN splats.

Cc Alexei Starovoitov <[email protected]>
Cc Andrii Nakryiko <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Boqun Feng <[email protected]>
Cc "Borislav Petkov (AMD)" <[email protected]>
Cc Daniel Borkman <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Eduard Zingerman <[email protected]>
Cc Gary Guo <[email protected]>
Cc Geert Uytterhoeven <[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]>

---

 include/linux/instrumented.h |    8 +++++++-
 lib/Kconfig.debug            |    8 ++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)
include/linux/instrumented.h renamed from include/linux/instrumented.h~atomic-add-option-for-weaker-alignment-check +7 -1
@@ -59,7 +59,13 @@ static __always_inline void instrument_r
 static __always_inline void instrument_atomic_check_alignment(const volatile void *v, size_t size)
 {
 #ifndef __DISABLE_EXPORTS
-	WARN_ON_ONCE(IS_ENABLED(CONFIG_DEBUG_ATOMIC) && ((unsigned long)v & (size - 1)));
+	if (IS_ENABLED(CONFIG_DEBUG_ATOMIC)) {
+		unsigned int mask = size - 1;
+
+		if (IS_ENABLED(CONFIG_DEBUG_ATOMIC_LARGEST_ALIGN))
+			mask &= sizeof(struct { long x; } __aligned_largest) - 1;
+		WARN_ON_ONCE((unsigned long)v & mask);
+	}
 #endif
 }
 
lib/Kconfig.debug renamed from lib/Kconfig.debug~atomic-add-option-for-weaker-alignment-check +8 -0
@@ -1370,6 +1370,14 @@ config DEBUG_ATOMIC
 
 	  This option has potentially significant overhead.
 
+config DEBUG_ATOMIC_LARGEST_ALIGN
+	bool "Check alignment only up to __aligned_largest"
+	depends on DEBUG_ATOMIC
+	help
+	  If you say Y here then the check for natural alignment of
+	  atomic accesses will be constrained to the compiler's largest
+	  alignment for scalar types.
+
 menu "Lock Debugging (spinlocks, mutexes, etc...)"
 
 config LOCK_DEBUGGING_SUPPORT

_

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