lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4475783a-73c1-94f1-804e-507abeb84ab1@redhat.com>
Date:   Mon, 19 Sep 2022 11:31:07 +0200
From:   David Hildenbrand <david@...hat.com>
To:     Michael Nazzareno Trimarchi <michael@...rulasolutions.com>
Cc:     Mike Rapoport <rppt@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: Correlation CMA size and FORCE_MAX_ZONEORDER

On 19.09.22 11:17, Michael Nazzareno Trimarchi wrote:
> Hi David
> 
> On Mon, Sep 19, 2022 at 10:38 AM David Hildenbrand <david@...hat.com> wrote:
>>
>> 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?
>>
> 
> I can run 6-rc2 on my board. I test again but according to it, if I
> put 4M as CMA in cma=4M in boot
> parameters, the result is 32Mb of CMA. Apart of that seems that
> process lime tiny membench can not even start
> to mblock memory
> 

The CMA alignemnt change went into v5.19. If "cma=4M" still gives you > 
4M, can you post /proc/meminfo and the early console output?


-- 
Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ