2

I am trying to enable HugeTLB Controller on cgroup v2 on my system but can't figure out how.

This is the list of controllers on my system:

cat /sys/fs/cgroup/cgroup.controllers 
cpuset cpu io memory pids rdma

And this is what I see for the meminfo on my system:

cat /proc/meminfo | grep Huge
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
FileHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:               0 kB

Am I missing something to enable the HugeTLB controller on cgroup v2? Is there a kernel flag, or some other setting that I need to enable?

2 Answers2

0

As you can read near to the bottom of the credited page, Control Group v2 does support the HugeTLB controller.

The difference with V1 being that all controllers which support v2 and are not bound to a v1 hierarchy are automatically bound to the v2 hierarchy and show up at the root.

No need for extra options to be specified as part of the mount command then and :

mount -t cgroup2 none $MOUNT_POINT

should suffice.

You can create some cgroup and check reading its associated cgroup.controllers file that the hugeTLB controller is available.

Of course (as any other controller) it is not activated by default.


Full credits to kernel.org official documentation.

MC68020
  • 6,281
  • 2
  • 13
  • 44
0

Most distribution kernels will have this config option set, but if you have compiled your own kernel you might have missed the CONFIG_CGROUP_HUGETLB option.

You can check if your current kernel has this option enabled with

grep CONFIG_CGROUP_HUGETLB /boot/config-`uname -r`

if it doesn't print CONFIG_CGROUP_HUGETLB=y you need to recompile your kernel with this option.

lluki
  • 1