This mount option will count HugeTLB memory usage towards the cgroup’s
overall memory usage for the memory controller.
See https://lore.kernel.org/all/
20231006184629.155543-4-nphamcs@gmail.com/T/#u
for the patch introducing the new mount option.
CHANGES WITH 259 in spe:
+ * The cgroup2 file system is now mounted with the
+ "memory_hugetlb_accounting" mount option, supported since kernel 6.6.
+ This means that HugeTLB memory usage is now counted towards the
+ cgroup’s overall memory usage for the memory controller.
+
* homectl's --recovery-key= option may now be used with the "update"
command to add recovery keys to existing user accounts. Previously,
recovery keys could only be configured during initial user creation.
≥ 6.3 for MFD_EXEC/MFD_NOEXEC_SEAL and tmpfs noswap option
≥ 6.5 for name_to_handle_at() AT_HANDLE_FID, SO_PEERPIDFD/SO_PASSPIDFD,
and MOVE_MOUNT_BENEATH
- ≥ 6.6 for quota support on tmpfs
+ ≥ 6.6 for quota support on tmpfs and cgroup2fs memory_hugetlb_accounting
+ option
≥ 6.9 for pidfs
≥ 6.10 for fcntl(F_DUPFD_QUERY), unprivileged linkat(AT_EMPTY_PATH),
and block device 'partscan' sysfs attribute
assert(ret);
_cleanup_free_ char *opts = NULL;
- FOREACH_STRING(o, "memory_recursiveprot") {
+ FOREACH_STRING(o, "memory_recursiveprot", "memory_hugetlb_accounting") {
r = mount_option_supported("cgroup2", o, /* value = */ NULL);
if (r < 0)
log_full_errno(priority, r, "Failed to determine whether cgroupfs supports '%s' mount option, assuming not: %m", o);