mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] mm/hugetlb_cgroup: move the per-node usage along with the folio
@ 2026-09-16  8:30 Hongfu Li
  2026-09-16  8:30 ` [PATCH 1/2] mm/hugetlb_cgroup: move per-node usage on cross node migration Hongfu Li
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Hongfu Li @ 2026-09-16  8:30 UTC (permalink / raw)
  To: Muchun Song, Oscar Salvador, David Hildenbrand, Andrew Morton,
	Kees Cook, Colin Ian King, Shakeel Butt, Mina Almasry
  Cc: Mike Kravetz, linux-mm, linux-kernel, Hongfu Li, hongfu.li, stable

The per-node usage reported by hugetlb.<size>.numa_stat is accounted
against folio_nid() in __hugetlb_cgroup_commit_charge() and
__hugetlb_cgroup_uncharge_folio(), so it is only correct while a folio
stays charged on the same node and in the same hugetlb_cgroup.

Two paths move a folio which stays charged, and neither moves the usage
with it. hugetlb_cgroup_migrate() only moves the hugetlb_cgroup pointers
of a folio migrated to another node, and hugetlb_cgroup_move_parent()
only moves the page_counter charges and the hugetlb_cgroup pointer of
the folios of a dying cgroup. In both cases the node (or cgroup) which
was charged keeps a usage which never goes away, while the node
(or cgroup) which ends up uncharging the folio underflows as soon as
the folio is freed.

Patch 1/2 moves the usage along with the folio on cross node migration,
patch 2/2 does the same for the folios a dying cgroup reparents.

Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
---
Hongfu Li (2):
      mm/hugetlb_cgroup: move per-node usage on cross node migration
      mm/hugetlb_cgroup: move per-node usage on cgroup reparenting

 mm/hugetlb_cgroup.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
---
base-commit: baa8de2f3448d1466a888a805c18d01c998fe052
change-id: 20260915-for-hugetlb-charge-2cfada8ed44e

Best regards,
--  
Hongfu Li <lihongfu@kylinos.cn>


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-09-17 10:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-16  8:30 [PATCH 0/2] mm/hugetlb_cgroup: move the per-node usage along with the folio Hongfu Li
2026-09-16  8:30 ` [PATCH 1/2] mm/hugetlb_cgroup: move per-node usage on cross node migration Hongfu Li
2026-09-17  5:58   ` Muchun Song
2026-09-17  9:59     ` Hongfu Li
2026-09-16  8:30 ` [PATCH 2/2] mm/hugetlb_cgroup: move per-node usage on cgroup reparenting Hongfu Li
2026-09-17  6:08   ` Muchun Song
2026-09-17  0:53 ` [PATCH 0/2] mm/hugetlb_cgroup: move the per-node usage along with the folio Andrew Morton
2026-09-17 10:17   ` Hongfu Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®