Skip to content

RFC mm: improve page allocator scalability via splitting zones

Huang Ying linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 14 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6mm: distinguish zone type and zone instance explicitlyarch/x86/mm/init.c drivers/crypto/omap-crypto.c drivers/crypto/omap-sham.c +27 more+397 -3360 replies
2/6mm: add struct zone_type_struct to describe zone typeinclude/linux/mm.h include/linux/mmzone.h mm/page_alloc.c+203 -1200 replies
3/6mm: support multiple zone instances per zone type in memory onlinemm/memory_hotplug.c+30 -80 replies
4/6mm: avoid show invalid zone in /proc/zoneinfoinclude/linux/mmzone.h mm/vmstat.c+7 -10 replies
5/6mm: create multiple zone instances for one zone type based on memory sizeinclude/linux/mmzone.h include/linux/page-flags-layout.h mm/page_alloc.c+107 -120 replies
6/6mm: prefer different zone list on different logical CPUinclude/linux/gfp.h include/linux/mmzone.h mm/mempolicy.c +2 more+77 -350 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/6] mm: improve page allocator scalability via splitting zones

The patchset is based on upstream v6.3.

More and more cores are put in one physical CPU (usually one NUMA node too). In 2023, one high-end server CPU has 56, 64, or more cores. Even more cores per physical CPU are planned for future CPUs. While all cores in one physical CPU will contend for the page allocation on one zone in most cases. This causes heavy zone lock contention in some workloads. And the situation will become worse and worse in the future.

For example, on an 2-socket Intel server machine with 224 logical CPUs, if the kernel is built with make -j224, the zone lock contention cycles% can reach up to about 12.7%.

To improve the scalability of the page allocation, in this series, we will create one zone instance for each about 256 GB memory of a zone type generally. That is, one large zone type will be split into multiple zone instances. Then, different logical CPUs will prefer different zone instances based on the logical CPU No. So the total number of logical CPUs contend on one zone will be reduced. Thus the scalability is improved.

With the series, the zone lock contention cycles% reduces to less than 1.6% in the above kbuild test case when 4 zone instances are created for ZONE_NORMAL.

Also tested the series with the will-it-scale/page_fault1 with 16 processes. With the optimization, the benchmark score increases up to 18.2% and the zone lock contention reduces from 13.01% to 0.56%.

To create multiple zone instances for a zone type, another choice is to create zone instances based on the total number of logical CPUs. We choose to use memory size because it is easier to be implemented. In most cases, the more the cores, the larger the memory size is. And, on system with larger memory size, the performance requirement of the page allocator is usually higher.

Best Regards,
Huang, Ying