archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <>
To: Vlastimil Babka <>
	Linux-FSDevel <>,
	linux-mm <>,, Michal Hocko <>,
	Christoph Lameter <>,
	David Rientjes <>,
	Pekka Enberg <>,
	Joonsoo Kim <>,
	Ming Lei <>,, Christoph Hellwig <>,
	Dave Chinner <>,
	"Darrick J . Wong" <>
Subject: Re: [LSF/MM TOPIC] guarantee natural alignment for kmalloc()?
Date: Thu, 11 Apr 2019 06:28:19 -0700	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Thu, Apr 11, 2019 at 02:52:08PM +0200, Vlastimil Babka wrote:
> In the session I hope to resolve the question whether this is indeed the
> right thing to do for all kmalloc() users, without an explicit alignment
> requests, and if it's worth the potentially worse
> performance/fragmentation it would impose on a hypothetical new slab
> implementation for which it wouldn't be optimal to split power-of-two
> sized pages into power-of-two-sized objects (or whether there are any
> other downsides).

I think this is exactly the kind of discussion that LSFMM is for!  It's
really a whole-system question; is Linux better-off having the flexibility
for allocators to return non-power-of-two aligned memory, or allowing
consumers of the kmalloc API to assume that "sufficiently large" memory
is naturally aligned.

Another possibility that should be considered is introducing a kmalloc()
variant like posix_memalign() that allows for specifying the alignment,
or just kmalloc_naturally_aligned().

And we probably need to reiterate for the benefit of those not following
the discussion that creating a slab cache (which does allow for alignment
to be specified) is impractical for this use case because the actual
allocations are of variable size, but always need to be 512-byte aligned.

  reply	other threads:[~2019-04-11 13:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11 12:52 [LSF/MM TOPIC] guarantee natural alignment for kmalloc()? Vlastimil Babka
2019-04-11 13:28 ` Matthew Wilcox [this message]
2019-04-25 11:33   ` Matthew Wilcox
2019-04-25 12:03     ` Martin K. Petersen
2019-04-25 12:03     ` Michal Hocko
2019-04-12  7:14 ` James Bottomley
2019-04-12  7:54   ` Vlastimil Babka
2019-04-16 15:38     ` Christopher Lameter
2019-04-17  8:07       ` 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:

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

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

* 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;
as well as URLs for NNTP newsgroup(s).