[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250825071247.GO3245006@noisy.programming.kicks-ass.net>
Date: Mon, 25 Aug 2025 09:12:47 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Finn Thain <fthain@...ux-m68k.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Lance Yang <lance.yang@...ux.dev>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Eero Tamminen <oak@...sinkinet.fi>, Will Deacon <will@...nel.org>,
stable@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] atomic: Specify natural alignment for atomic_t
On Mon, Aug 25, 2025 at 12:03:05PM +1000, Finn Thain wrote:
> Some recent commits incorrectly assumed the natural alignment of locks.
> That assumption fails on Linux/m68k (and, interestingly, would have failed
> on Linux/cris also). This leads to spurious warnings from the hang check
> code. Fix this bug by adding the necessary 'aligned' attribute.
>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Geert Uytterhoeven <geert@...ux-m68k.org>
> Cc: Lance Yang <lance.yang@...ux.dev>
> Cc: Masami Hiramatsu <mhiramat@...nel.org>
> Cc: Eero Tamminen <oak@...sinkinet.fi>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Will Deacon <will@...nel.org>
> Cc: stable@...r.kernel.org
> Reported-by: Eero Tamminen <oak@...sinkinet.fi>
> Closes: https://lore.kernel.org/lkml/CAMuHMdW7Ab13DdGs2acMQcix5ObJK0O2dG_Fxzr8_g58Rc1_0g@mail.gmail.com/
> Fixes: e711faaafbe5 ("hung_task: replace blocker_mutex with encoded blocker")
I don't see how this patch it at all relevant. Let along how its fixed
by the below.
> Signed-off-by: Finn Thain <fthain@...ux-m68k.org>
> ---
> I tested this on m68k using GCC and it fixed the problem for me. AFAIK,
> the other architectures naturally align ints already so I'm expecting to
> see no effect there.
> ---
> include/linux/types.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/types.h b/include/linux/types.h
> index 6dfdb8e8e4c3..cd5b2b0f4b02 100644
> --- a/include/linux/types.h
> +++ b/include/linux/types.h
> @@ -179,7 +179,7 @@ typedef phys_addr_t resource_size_t;
> typedef unsigned long irq_hw_number_t;
>
> typedef struct {
> - int counter;
> + int counter __aligned(sizeof(int));
> } atomic_t;
>
> #define ATOMIC_INIT(i) { (i) }
And your architecture doesn't trap on unaligned atomic access ?!!?!
Powered by blists - more mailing lists