v2
2026-11-03
memcg shrinker 按需分配 · v2
将每 memcg 的 shrinker_info_unit 改为 xarray 存储并按需分配,避免为未使用 shrinker 预分配内存。
原始补丁链接
子 Patch(2)
1/2
mm/shrinker: keep the per-memcg shrinker units in an xarray
Every memory cgroup keeps, per NUMA node, an array of pointers to its shrinker_info_units, sized for shrinker_nr_max ids. shrinker_nr_max is the highest memcg-aware shrinker id ever handed out; every
2/2
mm/shrinker: allocate the per-memcg shrinker units on demand
Instead of a shrinker_info_unit for every SHRINKER_UNIT_BITS ids up to shrinker_nr_max on every NUMA node, give a memory cgroup only the units of the shrinkers it or one of its descendants holds a lis