]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/hugetlb_cgroup: introduce peak and rsvd.peak to v2
authorXiu Jianfeng <xiujianfeng@huawei.com>
Tue, 2 Jul 2024 12:57:28 +0000 (12:57 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 17 Aug 2024 00:53:28 +0000 (17:53 -0700)
commite7779fae1ec3bc366ffe69648e4d8684456dd26c
tree98a3581fc2959b48fef58f8d18b60a9f2b7d0f0b
parentccbb07b2a3a768ad2bab9852731dadca5ac0457b
mm/hugetlb_cgroup: introduce peak and rsvd.peak to v2

Introduce peak and rsvd.peak to v2 to show the historical maximum usage of
resources, as in some scenarios it is necessary to configure the value of
max/rsvd.max based on the peak usage of resources.

Since HugeTLB doesn't support page reclaim, enforcing the limit at page
fault time implies that, the application will get SIGBUS signal if it
tries to fault in HugeTLB pages beyond its limit.  Therefore the
application needs to know exactly how many HugeTLB pages it uses before
hand, and the sysadmin needs to make sure that there are enough available
on the machine for all the users to avoid processes getting SIGBUS.

When running some open-source software, it may not be possible to know the
exact amount of hugetlb it consumes, so cannot correctly configure the max
value.  If there is a peak metric, we can run the open-source software
first and then configure the max based on the peak value.  In cgroup v1,
the hugetlb controller provides the max_usage_in_bytes and
rsvd.max_usage_in_bytes interface to display the historical maximum usage,
so introduce peak and rsvd.peak to v2 to address this issue.

Link: https://lkml.kernel.org/r/20240702125728.2743143-1-xiujianfeng@huawei.com
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Zefan Li <lizefan.x@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Documentation/admin-guide/cgroup-v2.rst
mm/hugetlb_cgroup.c