From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Alexander Graf <graf@amazon.com>, linux-kernel@vger.kernel.org
Cc: Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
Robin Murphy <robin.murphy@arm.com>,
linux-doc@vger.kernel.org, iommu@lists.linux.dev,
Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@kernel.org>,
Mike Rapoport <rppt@kernel.org>,
nh-open-source@amazon.com, linux-mm@kvack.org,
The AWS Nitro Enclaves Team <aws-nitro-enclaves-devel@amazon.com>
Subject: Re: [PATCH v2] dma-contiguous: support percentage sizes in cma_pernuma= and numa_cma=
Date: Thu, 19 Nov 2026 12:19:58 +0100 [thread overview]
Message-ID: <fa38a878-1735-4682-b208-5de1616f7e4f@samsung.com> (raw)
In-Reply-To: <20261114145328.1307-1-graf@amazon.com>
On 14.11.2026 15:53, Alexander Graf wrote:
> While CMA_SIZE_PERCENTAGE supports percentages for built-in defaults, the
> CMA allocation kernel parameters currently only take a fixed size argument.
> That makes it difficult to have a single system image that sizes its CMA
> allocation based on the available memory. To use CMA as backing pool for
> large, physically contiguous guest memory, I want to be able to say
> "allocate 90% of system RAM minus 1 GiB for CMA". Per NUMA node.
>
> Extend the CMA parser logic to accept command line options like this:
>
> cma_pernuma=80% numa_cma=0:95%-1G,1:4G
>
> To avoid incomplete allocations on parsing errors, check for them
> before actually allocating.
This looks like an over-engineered feature. I doubt that kernel is the right
place to implement such advanced sizing. If You need to explicitly control
the amount of CMA on the target machines, maybe You could do it in some
scripts deploying the kernel configuration? Calculating it there should be
much more flexible imho...
> Signed-off-by: Alexander Graf <graf@amazon.com>
> ---
> v1 -> v2:
>
> - Reject an empty numa_cma= and a trailing comma (Sashiko)
> - Keep the last valid size for each option or node, so an explicit 0
> now overrides a percentage (Sashiko)
> - Parse percentages as plain decimal, and reject sizes that a 32-bit
> phys_addr_t cannot hold
> - Reject a bare cma_pernuma or numa_cma without "=", which mainline
> dereferences as NULL
> - Rework the kernel-parameters.txt text accordingly
>
> v1: https://lore.kernel.org/all/20261111140440.43024-1-graf@amazon.com/
>
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
next prev parent reply other threads:[~2026-11-19 11:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20261114145340eucas1p2f7699b88eae34f7904cf68109dc3eb4f@eucas1p2.samsung.com>
2026-11-14 14:53 ` Alexander Graf
2026-11-19 11:19 ` Marek Szyprowski [this message]
2026-11-19 12:27 ` Graf (AWS), Alexander
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=fa38a878-1735-4682-b208-5de1616f7e4f@samsung.com \
--to=m.szyprowski@samsung.com \
--cc=akpm@linux-foundation.org \
--cc=aws-nitro-enclaves-devel@amazon.com \
--cc=corbet@lwn.net \
--cc=david@kernel.org \
--cc=graf@amazon.com \
--cc=iommu@lists.linux.dev \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nh-open-source@amazon.com \
--cc=rdunlap@infradead.org \
--cc=robin.murphy@arm.com \
--cc=rppt@kernel.org \
--cc=skhan@linuxfoundation.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 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®