Re: [PATCH v2 1/2] mm/page_alloc: use ac->high_zoneidx for classzone_idx

From: Vlastimil Babka
Date: Thu Mar 19 2020 - 08:21:29 EST


On 3/19/20 9:57 AM, Joonsoo Kim wrote:
>> Curious: is this only an issue when vm.numa_zonelist_order is set to Node?
>
> Do you mean "/proc/sys/vm/numa_zonelist_order"? It looks like it's gone now.
>
> Thanks.

Yes it's gone now, but indeed, AFAIU on older kernels with zone order instead of
node order, this problem wouldn't manifest.

This was in my reply to v1, 2 years ago :)

So to summarize;
- ac->high_zoneidx is computed via the arcane gfp_zone(gfp_mask) and
represents the highest zone the allocation can use
- classzone_idx was supposed to be the highest zone that the allocation can use,
that is actually available in the system. Somehow that became the highest zone
that is available on the preferred node (in the default node-order zonelist),
which causes the watermark inconsistencies you mention.