Re: [PATCH 1/4] memcg: store node_id instead of pglist_data pointer
From: Harry Yoo
Date: Wed May 20 2026 - 02:02:48 EST
On 5/20/26 2:31 PM, Shakeel Butt 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>
---
Reviewed-by: Harry Yoo (Oracle) <harry@xxxxxxxxxx>
--
Cheers,
Harry / Hyeonggon