linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Roman Gushchin <roman.gushchin@linux.dev>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: linux-mm@kvack.org, David Rientjes <rientjes@google.com>,
	Christoph Lameter <cl@linux.com>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	Kees Cook <keescook@chromium.org>,
	Alice Ryhl <aliceryhl@google.com>,
	Boqun Feng <boqun.feng@gmail.com>,
	rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
	patches@lists.linux.dev
Subject: Re: [PATCH] mm, slab: extend kmalloc() alignment for non power-of-two sizes
Date: Tue, 2 Jul 2024 21:13:02 +0000	[thread overview]
Message-ID: <ZoRtXgf7g5TU6HSz@google.com> (raw)
In-Reply-To: <1ca7b081-c1f0-45a3-b901-39c503368f43@suse.cz>

On Tue, Jul 02, 2024 at 10:25:44PM +0200, Vlastimil Babka wrote:
> On 7/2/24 9:30 PM, Roman Gushchin wrote:
> > On Tue, Jul 02, 2024 at 05:58:01PM +0200, Vlastimil Babka wrote:
> > Hello Vlastimil,
> > 
> > the idea and the implementation makes total sense to me.
> > 
> > Do you have an estimate for the memory overhead it will typically introduce?
> 
> There's no new overhead for the non-debug case as the layout already
> naturally has the same alignment as is now guaranteed. Debug has its own
> overhead so it's enabled only when needed, and this will not add much more.

Got it, but can you, please, add this note with some explanation why it's true
to the commit message? Because it's not obvious and the commit message makes
almost the opposite impression:
    Slab allocators have been guaranteeing natural alignment for
    power-of-two sizes <...>, while any other sizes are
    aligned only to ARCH_KMALLOC_MINALIGN bytes.

Should it be "guaranteed to be aligned" vs are actually aligned?

> 
> > I don't think it will be too large though and actually can be compensated
> > by potential performance gains due to a better memory alignment. What do you
> > think?
> 
> Yeah but again, the difference would be only in the debug case and
> performance gains there are not so interesting :)

Acked-by: Roman Gushchin <roman.gushchin@linux.dev>

Thanks!


  reply	other threads:[~2024-07-02 21:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-02 15:58 Vlastimil Babka
2024-07-02 16:40 ` Alice Ryhl
2024-07-02 21:18   ` Vlastimil Babka
2024-07-02 21:41     ` Boqun Feng
2024-07-02 19:30 ` Roman Gushchin
2024-07-02 20:25   ` Vlastimil Babka
2024-07-02 21:13     ` Roman Gushchin [this message]
2024-07-02 21:20       ` Vlastimil Babka

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=ZoRtXgf7g5TU6HSz@google.com \
    --to=roman.gushchin@linux.dev \
    --cc=42.hyeyoo@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=boqun.feng@gmail.com \
    --cc=cl@linux.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=patches@lists.linux.dev \
    --cc=rientjes@google.com \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=vbabka@suse.cz \
    /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