Re: [PATCH 1/9] mm/page_alloc: Split per cpu page lists and zone stats
From: Vlastimil Babka
Date: Thu Apr 22 2021 - 08:20:05 EST
On 4/22/21 1:14 PM, Mel Gorman wrote:
> The per-cpu page allocator lists and the per-cpu vmstat deltas are stored
> in the same struct per_cpu_pages even though vmstats have no direct impact
> on the per-cpu page lists. This is inconsistent because the vmstats for a
> node are stored on a dedicated structure. The bigger issue is that the
> per_cpu_pages structure is not cache-aligned and stat updates either
> cache conflict with adjacent per-cpu lists incurring a runtime cost or
> padding is required incurring a memory cost.
>
> This patch splits the per-cpu pagelists and the vmstat deltas into separate
> structures. It's mostly a mechanical conversion but some variable renaming
> is done to clearly distinguish the per-cpu pages structure (pcp) from
> the vmstats (pzstats).
>
> Superficially, this appears to increase the size of the per_cpu_pages
> structure but the movement of expire fills a structure hole so there is
> no impact overall.
>
> [lkp@xxxxxxxxx: Check struct per_cpu_zonestat has a non-zero size]
> [vbabka@xxxxxxx: Init zone->per_cpu_zonestats properly]
> Signed-off-by: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx>
Acked-by: Vlastimil Babka <vbabka@xxxxxxx>