mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Finn Thain" <fthain@linux-m68k.org>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Will Deacon" <will@kernel.org>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Mark Rutland" <mark.rutland@arm.com>,
	Linux-Arch <linux-arch@vger.kernel.org>,
	linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org,
	guoren <guoren@kernel.org>,
	"linux-csky@vger.kernel.org" <linux-csky@vger.kernel.org>,
	"Geert Uytterhoeven" <geert@linux-m68k.org>,
	"Dinh Nguyen" <dinguyen@kernel.org>,
	"Jonas Bonn" <jonas@southpole.se>,
	"Stefan Kristiansson" <stefan.kristiansson@saunalahti.fi>,
	"Stafford Horne" <shorne@gmail.com>,
	"linux-openrisc@vger.kernel.org" <linux-openrisc@vger.kernel.org>,
	"Yoshinori Sato" <ysato@users.sourceforge.jp>,
	"Rich Felker" <dalias@libc.org>,
	"John Paul Adrian Glaubitz" <glaubitz@physik.fu-berlin.de>,
	linux-sh@vger.kernel.org
Subject: Re: [PATCH v5 2/4] atomic: Specify alignment for atomic_t and atomic64_t
Date: Tue, 16 Dec 2025 08:18:37 +0100	[thread overview]
Message-ID: <3001d6a6-77b7-4ff4-8c8d-58dff8e6bdb6@app.fastmail.com> (raw)
In-Reply-To: <d6cd17b387fa4b4cf9f419ec586ac4756bc7aaeb.1765866665.git.fthain@linux-m68k.org>

On Tue, Dec 16, 2025, at 07:31, Finn Thain wrote:
> 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.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

  parent reply	other threads:[~2025-12-16  7:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-16  6:31 [PATCH v5 0/4] Align atomic storage Finn Thain
2025-12-16  6:31 ` [PATCH v5 1/4] bpf: Explicitly align bpf_res_spin_lock Finn Thain
2025-12-16  7:24   ` Arnd Bergmann
2025-12-16  6:31 ` [PATCH v5 4/4] atomic: Add option for weaker alignment check Finn Thain
2025-12-16  6:31 ` [PATCH v5 3/4] atomic: Add alignment check to instrumented atomic operations Finn Thain
2025-12-16  6:31 ` [PATCH v5 2/4] atomic: Specify alignment for atomic_t and atomic64_t Finn Thain
2025-12-16  7:04   ` Guo Ren
2025-12-16  7:18   ` Arnd Bergmann [this message]
2025-12-16 19:49 ` [PATCH v5 0/4] Align atomic storage Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3001d6a6-77b7-4ff4-8c8d-58dff8e6bdb6@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=boqun.feng@gmail.com \
    --cc=dalias@libc.org \
    --cc=dinguyen@kernel.org \
    --cc=fthain@linux-m68k.org \
    --cc=gary@garyguo.net \
    --cc=geert@linux-m68k.org \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=guoren@kernel.org \
    --cc=jonas@southpole.se \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-csky@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-openrisc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=peterz@infradead.org \
    --cc=shorne@gmail.com \
    --cc=stefan.kristiansson@saunalahti.fi \
    --cc=will@kernel.org \
    --cc=ysato@users.sourceforge.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®