* [PATCH v7 3/4] atomic: Add alignment check to instrumented atomic operations
2026-01-13 5:22 [PATCH v7 0/4] Align atomic storage Finn Thain
@ 2026-01-13 5:22 ` Finn Thain
2026-01-13 7:56 ` Geert Uytterhoeven
2026-01-14 13:07 ` Peter Zijlstra
2026-01-13 5:22 ` [PATCH v7 4/4] atomic: Add option for weaker alignment check Finn Thain
` (2 subsequent siblings)
3 siblings, 2 replies; 9+ messages in thread
From: Finn Thain @ 2026-01-13 5:22 UTC (permalink / raw)
To: Andrew Morton, Peter Zijlstra, Will Deacon
Cc: Arnd Bergmann, Boqun Feng, Gary Guo, Mark Rutland, linux-arch,
linux-kernel, linux-m68k, Sasha Levin, Thomas Gleixner,
Ingo Molnar, Borislav Petkov, Dave Hansen, Ard Biesheuvel,
H. Peter Anvin
From: Peter Zijlstra <peterz@infradead.org>
Add a Kconfig option for debug builds which logs a warning when an
instrumented atomic operation takes place that's misaligned.
Some platforms don't trap for this.
[ fthain: added __DISABLE_EXPORTS conditional and refactored as helper
function. ]
Cc: Sasha Levin <sashal@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Link: https://lore.kernel.org/lkml/20250901093600.GF4067720@noisy.programming.kicks-ass.net/
Link: https://lore.kernel.org/linux-next/df9fbd22-a648-ada4-fee0-68fe4325ff82@linux-m68k.org/
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
---
Checkpatch.pl says...
ERROR: Missing Signed-off-by: line by nominal patch author 'Peter Ziljstra <peterz@infradead.org>'
---
Changed since v6:
- Implemented helper function earlier in patch series, as requested by Ard.
- Dropped __DISABLE_BUG_TABLE macro in favour of __DISABLE_EXPORTS, as
requested by Peter.
Changed since v5:
- Add new __DISABLE_BUG_TABLE macro to prevent a build failure on those
architectures which use atomics in pre-boot code like the EFI stub loader:
x86_64-linux-gnu-ld: error: unplaced orphan section `__bug_table' from `arch/x86/boot/compressed/sev-handle-vc.o'
Changed since v2:
- Always check for natural alignment.
---
include/linux/instrumented.h | 11 +++++++++++
lib/Kconfig.debug | 10 ++++++++++
2 files changed, 21 insertions(+)
diff --git a/include/linux/instrumented.h b/include/linux/instrumented.h
index 711a1f0d1a73..e34b6a557e0a 100644
--- a/include/linux/instrumented.h
+++ b/include/linux/instrumented.h
@@ -7,6 +7,7 @@
#ifndef _LINUX_INSTRUMENTED_H
#define _LINUX_INSTRUMENTED_H
+#include <linux/bug.h>
#include <linux/compiler.h>
#include <linux/kasan-checks.h>
#include <linux/kcsan-checks.h>
@@ -55,6 +56,13 @@ static __always_inline void instrument_read_write(const volatile void *v, size_t
kcsan_check_read_write(v, size);
}
+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)));
+#endif
+}
+
/**
* instrument_atomic_read - instrument atomic read access
* @v: address of access
@@ -67,6 +75,7 @@ static __always_inline void instrument_atomic_read(const volatile void *v, size_
{
kasan_check_read(v, size);
kcsan_check_atomic_read(v, size);
+ instrument_atomic_check_alignment(v, size);
}
/**
@@ -81,6 +90,7 @@ static __always_inline void instrument_atomic_write(const volatile void *v, size
{
kasan_check_write(v, size);
kcsan_check_atomic_write(v, size);
+ instrument_atomic_check_alignment(v, size);
}
/**
@@ -95,6 +105,7 @@ static __always_inline void instrument_atomic_read_write(const volatile void *v,
{
kasan_check_write(v, size);
kcsan_check_atomic_read_write(v, size);
+ instrument_atomic_check_alignment(v, size);
}
/**
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index ba36939fda79..4b4d1445ef9c 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1359,6 +1359,16 @@ config DEBUG_PREEMPT
depending on workload as it triggers debugging routines for each
this_cpu operation. It should only be used for debugging purposes.
+config DEBUG_ATOMIC
+ bool "Debug atomic variables"
+ depends on DEBUG_KERNEL
+ help
+ If you say Y here then the kernel will add a runtime alignment check
+ to atomic accesses. Useful for architectures that do not have trap on
+ mis-aligned access.
+
+ This option has potentially significant overhead.
+
menu "Lock Debugging (spinlocks, mutexes, etc...)"
config LOCK_DEBUGGING_SUPPORT
--
2.49.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v7 3/4] atomic: Add alignment check to instrumented atomic operations
2026-01-13 5:22 ` [PATCH v7 3/4] atomic: Add alignment check to instrumented atomic operations Finn Thain
@ 2026-01-13 7:56 ` Geert Uytterhoeven
2026-01-14 3:53 ` Finn Thain
2026-01-14 13:07 ` Peter Zijlstra
1 sibling, 1 reply; 9+ messages in thread
From: Geert Uytterhoeven @ 2026-01-13 7:56 UTC (permalink / raw)
To: Finn Thain
Cc: Andrew Morton, Peter Zijlstra, Will Deacon, Arnd Bergmann,
Boqun Feng, Gary Guo, Mark Rutland, linux-arch, linux-kernel,
linux-m68k, Sasha Levin, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, Ard Biesheuvel, H. Peter Anvin
Hi Finn,
On Tue, 13 Jan 2026 at 06:39, Finn Thain <fthain@linux-m68k.org> wrote:
> From: Peter Zijlstra <peterz@infradead.org>
>
> Add a Kconfig option for debug builds which logs a warning when an
> instrumented atomic operation takes place that's misaligned.
> Some platforms don't trap for this.
>
> [ fthain: added __DISABLE_EXPORTS conditional and refactored as helper
> function. ]
>
> Cc: Sasha Levin <sashal@kernel.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Ard Biesheuvel <ardb@kernel.org>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Link: https://lore.kernel.org/lkml/20250901093600.GF4067720@noisy.programming.kicks-ass.net/
> Link: https://lore.kernel.org/linux-next/df9fbd22-a648-ada4-fee0-68fe4325ff82@linux-m68k.org/
> Signed-off-by: Finn Thain <fthain@linux-m68k.org>
>
> ---
> Checkpatch.pl says...
> ERROR: Missing Signed-off-by: line by nominal patch author 'Peter Ziljstra <peterz@infradead.org>'
Alternatively, you can credit Peter using
Suggested-by: Peter Zijlstra <peterz@infradead.org>
just before the Link-header pointing to his suggestion.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v7 3/4] atomic: Add alignment check to instrumented atomic operations
2026-01-13 7:56 ` Geert Uytterhoeven
@ 2026-01-14 3:53 ` Finn Thain
2026-01-16 0:27 ` Andrew Morton
0 siblings, 1 reply; 9+ messages in thread
From: Finn Thain @ 2026-01-14 3:53 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Andrew Morton, Peter Zijlstra, Will Deacon, Arnd Bergmann,
Boqun Feng, Gary Guo, Mark Rutland, linux-arch, linux-kernel,
linux-m68k, Sasha Levin, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, Ard Biesheuvel, H. Peter Anvin
On Tue, 13 Jan 2026, Geert Uytterhoeven wrote:
> >
> > ---
> > Checkpatch.pl says...
> > ERROR: Missing Signed-off-by: line by nominal patch author 'Peter Ziljstra <peterz@infradead.org>'
>
> Alternatively, you can credit Peter using
>
> Suggested-by: Peter Zijlstra <peterz@infradead.org>
>
> just before the Link-header pointing to his suggestion.
>
I'll leave that up to Peter as he's both author and maintainer.
If there was to be another revision, perhaps I can add --
Suggested-by-suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
;-)
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v7 3/4] atomic: Add alignment check to instrumented atomic operations
2026-01-14 3:53 ` Finn Thain
@ 2026-01-16 0:27 ` Andrew Morton
0 siblings, 0 replies; 9+ messages in thread
From: Andrew Morton @ 2026-01-16 0:27 UTC (permalink / raw)
To: Finn Thain
Cc: Geert Uytterhoeven, Peter Zijlstra, Will Deacon, Arnd Bergmann,
Boqun Feng, Gary Guo, Mark Rutland, linux-arch, linux-kernel,
linux-m68k, Sasha Levin, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, Ard Biesheuvel, H. Peter Anvin
On Wed, 14 Jan 2026 14:53:33 +1100 (AEDT) Finn Thain <fthain@linux-m68k.org> wrote:
>
> On Tue, 13 Jan 2026, Geert Uytterhoeven wrote:
>
> > >
> > > ---
> > > Checkpatch.pl says...
> > > ERROR: Missing Signed-off-by: line by nominal patch author 'Peter Ziljstra <peterz@infradead.org>'
> >
> > Alternatively, you can credit Peter using
> >
> > Suggested-by: Peter Zijlstra <peterz@infradead.org>
> >
> > just before the Link-header pointing to his suggestion.
> >
>
> I'll leave that up to Peter as he's both author and maintainer.
We have his signoff.
> If there was to be another revision, perhaps I can add --
>
> Suggested-by-suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
edited and added, thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v7 3/4] atomic: Add alignment check to instrumented atomic operations
2026-01-13 5:22 ` [PATCH v7 3/4] atomic: Add alignment check to instrumented atomic operations Finn Thain
2026-01-13 7:56 ` Geert Uytterhoeven
@ 2026-01-14 13:07 ` Peter Zijlstra
1 sibling, 0 replies; 9+ messages in thread
From: Peter Zijlstra @ 2026-01-14 13:07 UTC (permalink / raw)
To: Finn Thain
Cc: Andrew Morton, Will Deacon, Arnd Bergmann, Boqun Feng, Gary Guo,
Mark Rutland, linux-arch, linux-kernel, linux-m68k, Sasha Levin,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
Ard Biesheuvel, H. Peter Anvin
On Tue, Jan 13, 2026 at 04:22:28PM +1100, Finn Thain wrote:
> From: Peter Zijlstra <peterz@infradead.org>
>
> Add a Kconfig option for debug builds which logs a warning when an
> instrumented atomic operation takes place that's misaligned.
> Some platforms don't trap for this.
>
> [ fthain: added __DISABLE_EXPORTS conditional and refactored as helper
> function. ]
>
> Cc: Sasha Levin <sashal@kernel.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Ard Biesheuvel <ardb@kernel.org>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Link: https://lore.kernel.org/lkml/20250901093600.GF4067720@noisy.programming.kicks-ass.net/
> Link: https://lore.kernel.org/linux-next/df9fbd22-a648-ada4-fee0-68fe4325ff82@linux-m68k.org/
> Signed-off-by: Finn Thain <fthain@linux-m68k.org>
>
> ---
> Checkpatch.pl says...
> ERROR: Missing Signed-off-by: line by nominal patch author 'Peter Ziljstra <peterz@infradead.org>'
Feel free to add:
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v7 4/4] atomic: Add option for weaker alignment check
2026-01-13 5:22 [PATCH v7 0/4] Align atomic storage Finn Thain
2026-01-13 5:22 ` [PATCH v7 3/4] atomic: Add alignment check to instrumented atomic operations Finn Thain
@ 2026-01-13 5:22 ` Finn Thain
2026-01-13 5:22 ` [PATCH v7 2/4] atomic: Specify alignment for atomic_t and atomic64_t Finn Thain
2026-01-13 5:22 ` [PATCH v7 1/4] bpf: Explicitly align bpf_res_spin_lock Finn Thain
3 siblings, 0 replies; 9+ messages in thread
From: Finn Thain @ 2026-01-13 5:22 UTC (permalink / raw)
To: Andrew Morton, Peter Zijlstra, Will Deacon
Cc: Arnd Bergmann, Boqun Feng, Gary Guo, Mark Rutland, linux-arch,
linux-kernel, linux-m68k
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.
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
---
Changed since v6:
- Rebased.
Changed since v5:
- Rebased.
Changed since v3:
- Dropped #include <linux/cache.h> to avoid a build failure on arm64.
- Rewrote Kconfig help text to better describe preferred alignment.
- Refactored to avoid line-wrapping and duplication.
---
include/linux/instrumented.h | 8 +++++++-
lib/Kconfig.debug | 8 ++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/include/linux/instrumented.h b/include/linux/instrumented.h
index e34b6a557e0a..a1b4cf81adc2 100644
--- a/include/linux/instrumented.h
+++ b/include/linux/instrumented.h
@@ -59,7 +59,13 @@ static __always_inline void instrument_read_write(const volatile void *v, size_t
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
}
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 4b4d1445ef9c..977a2c9163a2 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1369,6 +1369,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
--
2.49.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v7 2/4] atomic: Specify alignment for atomic_t and atomic64_t
2026-01-13 5:22 [PATCH v7 0/4] Align atomic storage Finn Thain
2026-01-13 5:22 ` [PATCH v7 3/4] atomic: Add alignment check to instrumented atomic operations Finn Thain
2026-01-13 5:22 ` [PATCH v7 4/4] atomic: Add option for weaker alignment check Finn Thain
@ 2026-01-13 5:22 ` Finn Thain
2026-01-13 5:22 ` [PATCH v7 1/4] bpf: Explicitly align bpf_res_spin_lock Finn Thain
3 siblings, 0 replies; 9+ messages in thread
From: Finn Thain @ 2026-01-13 5:22 UTC (permalink / raw)
To: Andrew Morton, Peter Zijlstra, Will Deacon
Cc: Arnd Bergmann, Boqun Feng, Gary Guo, Mark Rutland, linux-arch,
linux-kernel, linux-m68k, Guo Ren, linux-csky, Geert Uytterhoeven,
Dinh Nguyen, Jonas Bonn, Stefan Kristiansson, Stafford Horne,
linux-openrisc, Yoshinori Sato, Rich Felker,
John Paul Adrian Glaubitz, linux-sh
Some recent commits incorrectly assumed 4-byte alignment of locks.
That assumption fails on Linux/m68k (and, interestingly, would have
failed on Linux/cris also). The jump label implementation makes a
similar alignment assumption.
The expectation that atomic_t and atomic64_t variables will be naturally
aligned seems reasonable, as indeed they are on 64-bit architectures.
But atomic64_t isn't naturally aligned on csky, m68k, microblaze, nios2,
openrisc and sh. Neither atomic_t nor atomic64_t are naturally aligned
on m68k.
This patch brings a little uniformity by specifying natural alignment
for atomic types. One benefit is that atomic64_t variables do not get
split across a page boundary. The cost is that some structs grow which
leads to cache misses and wasted memory.
See also, commit bbf2a330d92c ("x86: atomic64: The atomic64_t data type
should be 8 bytes aligned on 32-bit too").
Cc: Guo Ren <guoren@kernel.org>
Cc: linux-csky@vger.kernel.org
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: Stafford Horne <shorne@gmail.com>
Cc: linux-openrisc@vger.kernel.org
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: linux-sh@vger.kernel.org
Link: https://lore.kernel.org/lkml/CAFr9PX=MYUDGJS2kAvPMkkfvH+0-SwQB_kxE4ea0J_wZ_pk=7w@mail.gmail.com
Link: https://lore.kernel.org/lkml/CAMuHMdW7Ab13DdGs2acMQcix5ObJK0O2dG_Fxzr8_g58Rc1_0g@mail.gmail.com/
Acked-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
---
Changed since v5:
- Added tags from Guo Ren and Arnd Bergmann.
Changed since v2:
- Specify natural alignment for atomic64_t.
Changed since v1:
- atomic64_t now gets an __aligned attribute too.
- The 'Fixes' tag has been dropped because Lance sent a different fix
for commit e711faaafbe5 ("hung_task: replace blocker_mutex with encoded
blocker") that's suitable for -stable.
---
include/asm-generic/atomic64.h | 2 +-
include/linux/types.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/asm-generic/atomic64.h b/include/asm-generic/atomic64.h
index 100d24b02e52..f22ccfc0df98 100644
--- a/include/asm-generic/atomic64.h
+++ b/include/asm-generic/atomic64.h
@@ -10,7 +10,7 @@
#include <linux/types.h>
typedef struct {
- s64 counter;
+ s64 __aligned(sizeof(s64)) counter;
} atomic64_t;
#define ATOMIC64_INIT(i) { (i) }
diff --git a/include/linux/types.h b/include/linux/types.h
index d4437e9c452c..1760e1feeab9 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -180,7 +180,7 @@ typedef phys_addr_t resource_size_t;
typedef unsigned long irq_hw_number_t;
typedef struct {
- int counter;
+ int __aligned(sizeof(int)) counter;
} atomic_t;
#define ATOMIC_INIT(i) { (i) }
--
2.49.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v7 1/4] bpf: Explicitly align bpf_res_spin_lock
2026-01-13 5:22 [PATCH v7 0/4] Align atomic storage Finn Thain
` (2 preceding siblings ...)
2026-01-13 5:22 ` [PATCH v7 2/4] atomic: Specify alignment for atomic_t and atomic64_t Finn Thain
@ 2026-01-13 5:22 ` Finn Thain
3 siblings, 0 replies; 9+ messages in thread
From: Finn Thain @ 2026-01-13 5:22 UTC (permalink / raw)
To: Andrew Morton, Peter Zijlstra, Will Deacon
Cc: Arnd Bergmann, Boqun Feng, Gary Guo, Mark Rutland, linux-arch,
linux-kernel, linux-m68k, Alexei Starovoitov, Daniel Borkmann,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
Hao Luo, Jiri Olsa, Geert Uytterhoeven, bpf
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 <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
Acked-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
---
Changed since v5:
- Added tag from Arnd Bergmann.
---
include/asm-generic/rqspinlock.h | 2 +-
kernel/bpf/rqspinlock.c | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/include/asm-generic/rqspinlock.h b/include/asm-generic/rqspinlock.h
index 0f2dcbbfee2f..dd36ac96bf66 100644
--- a/include/asm-generic/rqspinlock.h
+++ b/include/asm-generic/rqspinlock.h
@@ -28,7 +28,7 @@ struct rqspinlock {
*/
struct bpf_res_spin_lock {
u32 val;
-};
+} __aligned(__alignof__(struct rqspinlock));
struct qspinlock;
#ifdef CONFIG_QUEUED_SPINLOCKS
diff --git a/kernel/bpf/rqspinlock.c b/kernel/bpf/rqspinlock.c
index f7d0c8d4644e..8d892fb099ac 100644
--- a/kernel/bpf/rqspinlock.c
+++ b/kernel/bpf/rqspinlock.c
@@ -694,7 +694,6 @@ __bpf_kfunc int bpf_res_spin_lock(struct bpf_res_spin_lock *lock)
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);
--
2.49.1
^ permalink raw reply related [flat|nested] 9+ messages in thread