mem_cgroup_charge_hugetlb(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… mem_cgroup_charge_hugetlb(9) πŸ’…

Okay bestie, welcome to this page from the Kernel API Manual 🫢. We’re talking about mem_cgroup_charge_hugetlb(9) today, and it’s honestly giving β€œsmall function, big memcg responsibilities” energy πŸ‘‘.

πŸ’– NAME πŸ’–

mem_cgroup_charge_hugetlb β€” charge the memcg for a hugetlb folio πŸ’Έβœ¨

✨ SYNOPSIS ✨

int mem_cgroup_charge_hugetlb (struct folio *folio , gfp_t gfp );

πŸŽ€ ARGUMENTS πŸŽ€

  • folio β€” the folio being charged πŸ’–
  • gfp β€” reclaim mode 🌱

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here’s the vibe: this function is called when allocating a huge page folio, after the page has already been obtained and charged to the appropriate hugetlb cgroup controller (if it is enabled) ✨.

If the memcg is already full, it returns ENOMEM 😭. If the charge was successful β€” or if we skip the charging β€” it returns 0 🫢.

🌸 SEE ALSO 🌸

The kernel file is ./mm/memcontrol.c πŸ‘€. And here’s the whole related squad, same order, no cap:


This page’s source/version is ./mm, dated October 2026, and the manual page name is mem_cgroup_charge_hugetlb(9). Byeee, go slay your kernel adventures πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from