Re: [PATCH 1/4] memcg: store node_id instead of pglist_data pointer

From: Muchun Song

Date: Wed May 20 2026 - 02:16:21 EST




> On May 20, 2026, at 13:31, Shakeel Butt <shakeel.butt@xxxxxxxxx> wrote:
>
> The struct obj_stock_pcp stores a pointer to pglist_data for the slab
> stats cached on the cpu. On 64-bit machines, this costs 8 bytes. The
> pointer is not strictly required: NODE_DATA() can recover it from the
> node id. Replace cached_pgdat with int16_t node_id and use NUMA_NO_NODE
> as the "no stats cached" sentinel.
>
> At the moment all the archs limit MAX_NUMNODES to 1024 so int16_t is
> plenty; a BUILD_BUG_ON() makes sure we notice if that ever changes.
>
> Signed-off-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>
> Tested-by: kernel test robot <oliver.sang@xxxxxxxxx>

Acked-by: Muchun Song <muchun.song@xxxxxxxxx>

Thanks.