Re: [PATCH 2/2] mm/hugetlb_cgroup: move per-node usage on cgroup reparenting

From: Muchun Song

Date: Thu Sep 17 2026 - 02:11:08 EST




> On Sep 16, 2026, at 16:30, Hongfu Li <hongfu.li@xxxxxxxxx> wrote:
>
> From: Hongfu Li <lihongfu@xxxxxxxxxx>
>
> hugetlb_cgroup_css_offline() hands the folios of a dying cgroup over to
> its parent with hugetlb_cgroup_move_parent(), which moves the page_counter
> charges and the hugetlb_cgroup pointer of the folio but not its per-node
> usage. The parent's hugetlb.<size>.numa_stat is short by that usage while
> they are charged, and underflows once they are freed, exposing incorrect
> per-node usage values to userspace.
>
> Move the per-node usage to the parent as well. The folios keep their node
> here, so only the cgroup which holds the usage changes.
>
> Fixes: f47761999052 ("hugetlb: add hugetlb.*.numa_stat file")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Hongfu Li <lihongfu@xxxxxxxxxx>

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