History

mm: hugetlb controller for cgroups v2

In the effort of supporting cgroups v2 into Kubernetes, I stumped on the lack of the hugetlb controller. When the controller is enabled, it exposes four new files for each hugetlb size on non-root cgroups: - hugetlb.<hugepagesize>.current - hugetlb.<hugepagesize>.max - hugetlb.<hugepagesize>.events - hugetlb.<hugepagesize>.events.local The differences with the legacy hierarchy are in the file names and using the value "max" instead of "-1" to disable a limit. The file .limit_in_bytes is renamed to .max. The file .usage_in_bytes is renamed to .current. .failcnt is not provided as a single file anymore, but its value can be read through the new flat-keyed files .events and .events.local, through the "max" key.

Giuseppe Scrivano committed 6 years ago

Commit faced7e1 parent 6afa8733 files · +218 −12Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/hugetlb.h+2−1
@@ -432,7 +432,8 @@ struct hstate { · 431 unmodified lines
432 unsigned int surplus_huge_pages_node[MAX_NUMNODES];432 unsigned int surplus_huge_pages_node[MAX_NUMNODES];
433#ifdef CONFIG_CGROUP_HUGETLB433#ifdef CONFIG_CGROUP_HUGETLB
434 /* cgroup control files */434 /* cgroup control files */
435 struct cftype cgroup_files[5];435 struct cftype cgroup_files_dfl[5];
436 struct cftype cgroup_files_legacy[5];
436#endif437#endif
437 char name[HSTATE_NAME_LEN];438 char name[HSTATE_NAME_LEN];
438};439};

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t