mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Michael Nazzareno Trimarchi <michael@amarulasolutions.com>,
	Mike Rapoport <rppt@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: Correlation CMA size and FORCE_MAX_ZONEORDER
Date: Mon, 19 Sep 2022 10:38:47 +0200	[thread overview]
Message-ID: <826cd775-14d2-12ae-2e96-cf0766aa1502@redhat.com> (raw)
In-Reply-To: <CAOf5uwk=Tx+W-JuJBXUYjt2BLmSvr9Q153D1RTyJG_cmeO4AUw@mail.gmail.com>

On 15.09.22 23:36, Michael Nazzareno Trimarchi wrote:
> Hi all

Hi,

> 
> Working on a small device with 128MB of memory and using imx_v6_v7
> defconfig I found that CMA_SIZE_MBYTES, CMA_SIZE_PERCENTAGE
> are not respected. The calculation done does not allow the requested
> size. I think that this should be somehow documented and described but
> I did not
> find the documentation. Does it work this way?
> 
> With CMA_SIZE of 8MB I need to have FORCE_MAX_ZONEORDER=12 if I have
> the default FORCE_MAX_ZONEORDER=14 the min size is 32Mb

The underlying constraint is that CMA regions require a certain minimum 
alignment+size. They cannot be arbitrarily in size.

CMA_MIN_ALIGNMENT_BYTES expresses that, and corresponds in upstream 
kernels to the size of a single pageblock.

In previous kernels, it used to be the size of the largest buddy 
allocation granularity (derived from MAX_ORDER, derived from 
FORCE_MAX_ZONEORDER).

On upstream kernels, the FORCE_MAX_ZONEORDER constraint should no longer 
apply. On most archs, the minimum alignment+size should be 2 MiB 
(x86-64, aarch64 with 4k base pages) -- the size of a single pageblock.

So far the theory. Are you still running into this limitation on 
upstream kernels?

-- 
Thanks,

David / dhildenb


  reply	other threads:[~2022-09-19  8:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-15 21:36 Michael Nazzareno Trimarchi
2022-09-19  8:38 ` David Hildenbrand [this message]
2022-09-19  9:17   ` Michael Nazzareno Trimarchi
2022-09-19  9:31     ` David Hildenbrand
2022-09-19  9:57       ` Michael Nazzareno Trimarchi
2022-09-19 11:03         ` David Hildenbrand
2022-09-19 11:17           ` Michael Nazzareno Trimarchi
2022-09-19 11:28             ` David Hildenbrand
2022-09-19 11:59               ` Michael Nazzareno Trimarchi
2022-09-19 12:08                 ` David Hildenbrand
2022-09-19 12:11                   ` Michael Nazzareno Trimarchi

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=826cd775-14d2-12ae-2e96-cf0766aa1502@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@amarulasolutions.com \
    --cc=rppt@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 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®