From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Arnd Bergmann <arnd@arndb.de>, Will Deacon <will@kernel.org>,
Marc Zyngier <maz@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Herbert Xu <herbert@gondor.apana.org.au>,
Ard Biesheuvel <ardb@kernel.org>, Christoph Hellwig <hch@lst.de>,
Isaac Manjarres <isaacmanjarres@google.com>,
Saravana Kannan <saravanak@google.com>,
linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 1/2] mm: slab: Introduce __GFP_PACKED for smaller kmalloc() alignments
Date: Wed, 26 Oct 2022 08:39:04 +0200 [thread overview]
Message-ID: <Y1jWCCd2Kkcrk0W/@kroah.com> (raw)
In-Reply-To: <20221025205247.3264568-2-catalin.marinas@arm.com>
On Tue, Oct 25, 2022 at 09:52:46PM +0100, Catalin Marinas wrote:
> By default kmalloc() returns objects aligned to ARCH_KMALLOC_MINALIGN.
> This can be somewhat large on architectures defining ARCH_DMA_MINALIGN
> (e.g. 128 on arm64) and significant memory is wasted through small
> kmalloc() allocations.
>
> Reduce the minimum alignment for kmalloc() to the default
> KMALLOC_MIN_SIZE (8 for slub, 32 for slab) but align the
> requested size to the bigger ARCH_KMALLOC_MINALIGN unless a newly added
> __GFP_PACKED flag is passed. With this gfp flag, the alignment is
> reduced to KMALLOC_PACKED_ALIGN, at least sizeof(unsigned long long).
Can memory allocated with __GFP_PACKED be sent to DMA controllers?
If not, you should say that somewhere here or I'm going to get a bunch
of patches trying to add this flag to tiny USB urb allocations (where we
allocate 8 or 16 bytes) that is then going to fail on some hardware.
thanks,
greg k-h
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Arnd Bergmann <arnd@arndb.de>, Will Deacon <will@kernel.org>,
Marc Zyngier <maz@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Herbert Xu <herbert@gondor.apana.org.au>,
Ard Biesheuvel <ardb@kernel.org>, Christoph Hellwig <hch@lst.de>,
Isaac Manjarres <isaacmanjarres@google.com>,
Saravana Kannan <saravanak@google.com>,
linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 1/2] mm: slab: Introduce __GFP_PACKED for smaller kmalloc() alignments
Date: Wed, 26 Oct 2022 08:39:04 +0200 [thread overview]
Message-ID: <Y1jWCCd2Kkcrk0W/@kroah.com> (raw)
In-Reply-To: <20221025205247.3264568-2-catalin.marinas@arm.com>
On Tue, Oct 25, 2022 at 09:52:46PM +0100, Catalin Marinas wrote:
> By default kmalloc() returns objects aligned to ARCH_KMALLOC_MINALIGN.
> This can be somewhat large on architectures defining ARCH_DMA_MINALIGN
> (e.g. 128 on arm64) and significant memory is wasted through small
> kmalloc() allocations.
>
> Reduce the minimum alignment for kmalloc() to the default
> KMALLOC_MIN_SIZE (8 for slub, 32 for slab) but align the
> requested size to the bigger ARCH_KMALLOC_MINALIGN unless a newly added
> __GFP_PACKED flag is passed. With this gfp flag, the alignment is
> reduced to KMALLOC_PACKED_ALIGN, at least sizeof(unsigned long long).
Can memory allocated with __GFP_PACKED be sent to DMA controllers?
If not, you should say that somewhere here or I'm going to get a bunch
of patches trying to add this flag to tiny USB urb allocations (where we
allocate 8 or 16 bytes) that is then going to fail on some hardware.
thanks,
greg k-h
next prev parent reply other threads:[~2022-10-26 6:39 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-25 20:52 [PATCH v2 0/2] mm: Allow kmalloc() allocations below ARCH_KMALLOC_MINALIGN Catalin Marinas
2022-10-25 20:52 ` Catalin Marinas
2022-10-25 20:52 ` [PATCH v2 1/2] mm: slab: Introduce __GFP_PACKED for smaller kmalloc() alignments Catalin Marinas
2022-10-25 20:52 ` Catalin Marinas
2022-10-26 6:39 ` Greg Kroah-Hartman [this message]
2022-10-26 6:39 ` Greg Kroah-Hartman
2022-10-26 8:39 ` Catalin Marinas
2022-10-26 8:39 ` Catalin Marinas
2022-10-26 9:49 ` Greg Kroah-Hartman
2022-10-26 9:49 ` Greg Kroah-Hartman
2022-10-26 9:58 ` Catalin Marinas
2022-10-26 9:58 ` Catalin Marinas
2022-10-27 12:11 ` Hyeonggon Yoo
2022-10-27 12:11 ` Hyeonggon Yoo
2022-10-28 7:32 ` Catalin Marinas
2022-10-28 7:32 ` Catalin Marinas
2022-10-25 20:52 ` [PATCH v2 2/2] treewide: Add the __GFP_PACKED flag to several non-DMA kmalloc() allocations Catalin Marinas
2022-10-25 20:52 ` Catalin Marinas
2022-10-26 6:50 ` Greg Kroah-Hartman
2022-10-26 6:50 ` Greg Kroah-Hartman
2022-10-26 9:48 ` Catalin Marinas
2022-10-26 9:48 ` Catalin Marinas
2022-10-26 12:59 ` Greg Kroah-Hartman
2022-10-26 12:59 ` Greg Kroah-Hartman
2022-10-26 17:09 ` Catalin Marinas
2022-10-26 17:09 ` Catalin Marinas
2022-10-26 17:21 ` Greg Kroah-Hartman
2022-10-26 17:21 ` Greg Kroah-Hartman
2022-10-26 17:46 ` Linus Torvalds
2022-10-26 17:46 ` Linus Torvalds
2022-10-27 22:29 ` Catalin Marinas
2022-10-27 22:29 ` Catalin Marinas
2022-10-28 9:37 ` Greg Kroah-Hartman
2022-10-28 9:37 ` Greg Kroah-Hartman
2022-10-28 9:37 ` Greg Kroah-Hartman
2022-10-28 9:37 ` Greg Kroah-Hartman
2022-10-30 8:47 ` Christoph Hellwig
2022-10-30 8:47 ` Christoph Hellwig
2022-10-30 9:02 ` Greg Kroah-Hartman
2022-10-30 9:02 ` Greg Kroah-Hartman
2022-10-30 9:13 ` Christoph Hellwig
2022-10-30 9:13 ` Christoph Hellwig
2022-10-30 16:43 ` Catalin Marinas
2022-10-30 16:43 ` Catalin Marinas
2022-11-01 10:59 ` Christoph Hellwig
2022-11-01 10:59 ` Christoph Hellwig
2022-11-01 17:19 ` Catalin Marinas
2022-11-01 17:19 ` Catalin Marinas
2022-11-01 17:24 ` Christoph Hellwig
2022-11-01 17:24 ` Christoph Hellwig
2022-11-01 17:32 ` Catalin Marinas
2022-11-01 17:32 ` Catalin Marinas
2022-11-01 17:39 ` Christoph Hellwig
2022-11-01 17:39 ` Christoph Hellwig
2022-11-01 19:10 ` Isaac Manjarres
2022-11-01 19:10 ` Isaac Manjarres
2022-11-02 11:05 ` Catalin Marinas
2022-11-02 11:05 ` Catalin Marinas
2022-11-02 20:50 ` Isaac Manjarres
2022-11-02 20:50 ` Isaac Manjarres
2022-11-01 18:14 ` Robin Murphy
2022-11-01 18:14 ` Robin Murphy
2022-11-02 13:10 ` Catalin Marinas
2022-11-02 13:10 ` Catalin Marinas
2022-10-30 8:46 ` Christoph Hellwig
2022-10-30 8:46 ` Christoph Hellwig
2022-10-30 8:44 ` Christoph Hellwig
2022-10-30 8:44 ` Christoph Hellwig
2022-11-03 16:15 ` Vlastimil Babka
2022-11-03 16:15 ` Vlastimil Babka
2022-11-03 18:03 ` Catalin Marinas
2022-11-03 18:03 ` Catalin Marinas
2022-10-26 6:54 ` [PATCH v2 0/2] mm: Allow kmalloc() allocations below ARCH_KMALLOC_MINALIGN Greg Kroah-Hartman
2022-10-26 6:54 ` Greg Kroah-Hartman
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=Y1jWCCd2Kkcrk0W/@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=akpm@linux-foundation.org \
--cc=ardb@kernel.org \
--cc=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=hch@lst.de \
--cc=herbert@gondor.apana.org.au \
--cc=isaacmanjarres@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=maz@kernel.org \
--cc=saravanak@google.com \
--cc=torvalds@linux-foundation.org \
--cc=will@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.