M HYPE SPLASH
// updates

What is the purpose of cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 swapaccount=1

By Abigail Rogers

I am trying to setup a kubernetes cluster on a raspberry pi cluster using Ubuntu 20.04.3. In many online guides available, one of the steps is mentioned as follows:

Edit the /boot/firmware/cmdline.txt and add cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 swapaccount=1 at the end.

The above step is mentioned without any explanation. So, to check my current configuration (without applying the above boot config) I run /proc/cgroups which gives me the following output:

#subsys_name hierarchy num_cgroups enabled
cpuset 8 1 1
cpu 4 43 1
cpuacct 4 43 1
blkio 7 43 1
memory 0 51 0
devices 10 43 1
freezer 3 2 1
net_cls 2 1 1
perf_event 5 1 1
net_prio 2 1 1
pids 6 48 1
rdma 9 1 1

Since swap needs to be disabled, I have checked it is already disabled. As such I have the following questions:

  1. I believe in the output that cpuset is enabled since it has the value of 1 for the enabled column. Am I correct? If so, is explicitly setting cgroup_enable=cpuset necessary?
  2. Since the value under enabled is 0 for memory I believe it is not enabled. Am I correct? If so, what does cgroup_enable=memory and cgroup_memory=1 do? Why do I have to set both of them?
  3. What is the purpose of setting swapaccount=1? Does it make sense to set it if swap is disabled anyway?

cgroups is a new topic to me and as such I would like to know better what each of the commands do instead of blindly copying them.

EDIT: I went through the kernel source code and noticed that nothing called cgroup_memory exists. Yes a function exists by that name but it binds to a command cgroup.memory. So, are all the online blogs talking about cgroup_memory just copied a typo as is?

1 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy