Re: [PATCH] mm/pages_alloc.c: Don't create ZONE_MOVABLE beyond the end of a node

Oscar Salvador
2022-02-15T06:15:49Z

On Tue, Feb 15, 2022 at 10:17:09AM +0530, Anshuman Khandual wrote:
> Hi Alistair,
>
> On 2/15/22 8:28 AM, Alistair Popple wrote:
> > ZONE_MOVABLE uses the remaining memory in each node. It's starting pfn
> > is also aligned to MAX_ORDER_NR_PAGES. It is possible for the remaining
> > memory in a node to be less than MAX_ORDER_NR_PAGES, meaning there is
> > not enough room for ZONE_MOVABLE on that node.

CC Mel as he wrote that back then.

I was curious about the commit that introduced that, and I found
[1] and [2].
I guess [2] was eventually dismissed in favor of [1] as a whole, but in
there the commit message said:

"This patch rounds the start of ZONE_MOVABLE in each node to a
MAX_ORDER_NR_PAGES boundary. If the rounding pushes the start of ZONE_MOVABLE
above the end of the node then the zone will contain no memory and will not
be used at runtime"

I might be missing something, but it just rounds up the value, but does
not check if it falls beyond node's boundaries.

[1] commit 2a1e274acf0b1c192face19a4be7c12d4503eaaf "Create the
ZONE_MOVABLE zone"
[2] https://marc.info/?l=linux-mm&m=117743777129526&w=2

--
Oscar Salvador
SUSE Labs