linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] hugetlb memcg accounting
@ 2023-09-26 19:49 Nhat Pham
  2023-09-26 19:49 ` [PATCH 1/2] hugetlb: memcg: account hugetlb-backed memory in memory controller Nhat Pham
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Nhat Pham @ 2023-09-26 19:49 UTC (permalink / raw)
  To: akpm
  Cc: riel, hannes, mhocko, roman.gushchin, shakeelb, muchun.song, tj,
	lizefan.x, shuah, mike.kravetz, yosryahmed, linux-mm,
	kernel-team, linux-kernel, cgroups

Currently, hugetlb memory usage is not acounted for in the memory
controller, which could lead to memory overprotection for cgroups with
hugetlb-backed memory. This has been observed in our production system.

This patch series rectifies this issue by charging the memcg when the
hugetlb folio is allocated, and uncharging when the folio is freed. In
addition, a new selftest is added to demonstrate and verify this new
behavior.

Nhat Pham (2):
  hugetlb: memcg: account hugetlb-backed memory in memory controller
  selftests: add a selftest to verify hugetlb usage in memcg

 MAINTAINERS                                   |   2 +
 fs/hugetlbfs/inode.c                          |   2 +-
 include/linux/hugetlb.h                       |   6 +-
 include/linux/memcontrol.h                    |   8 +
 mm/hugetlb.c                                  |  23 +-
 mm/memcontrol.c                               |  40 ++++
 tools/testing/selftests/cgroup/.gitignore     |   1 +
 tools/testing/selftests/cgroup/Makefile       |   2 +
 .../selftests/cgroup/test_hugetlb_memcg.c     | 222 ++++++++++++++++++
 9 files changed, 297 insertions(+), 9 deletions(-)
 create mode 100644 tools/testing/selftests/cgroup/test_hugetlb_memcg.c

-- 
2.34.1


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

end of thread, other threads:[~2023-10-02 15:36 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-26 19:49 [PATCH 0/2] hugetlb memcg accounting Nhat Pham
2023-09-26 19:49 ` [PATCH 1/2] hugetlb: memcg: account hugetlb-backed memory in memory controller Nhat Pham
2023-09-26 20:50 ` [PATCH 0/2] hugetlb memcg accounting Frank van der Linden
2023-09-26 22:14   ` Johannes Weiner
2023-09-27 12:50     ` Michal Hocko
2023-09-27 16:44       ` Johannes Weiner
2023-09-27 17:22         ` Nhat Pham
2023-09-26 23:31   ` Nhat Pham
2023-09-27 11:21 ` Michal Hocko
2023-09-27 18:47   ` Johannes Weiner
2023-09-27 21:37     ` Roman Gushchin
2023-09-28 12:52       ` Johannes Weiner
2023-10-01 23:27     ` Mike Kravetz
2023-10-02 14:42       ` Johannes Weiner
2023-10-02 14:58         ` Michal Hocko
2023-10-02 15:36           ` Johannes Weiner
2023-09-27 23:33   ` Nhat Pham
2023-09-28  1:00 ` Nhat Pham

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