Skip to content

Add cpuset support for the Android container

Flo Lee requested to merge add-cupset-stuff into master

This was the long-missing link how to get cpuset FS into the container and the right place. Kudos to @stgraber!

This needs to be accompanied by a patch into each Halium version like this one for H7.1: https://github.com/Halium/android_system_core/pull/15

From https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html:

Avoid Name Collisions

Interface files for a cgroup and its children cgroups occupy the same directory and it is possible to create children cgroups which collide with interface files. All cgroup core interface files are prefixed with “cgroup.” and each controller’s interface files are prefixed with the controller name and a dot.

For Android the choice was to use the "noprefix" mount option for the cgroup cpuset controller. This is only allowed and effective if there is only ONE cgroup controller mounted, to prevent name collisions as written above.

Ubuntu Touch however uses more cgroup controllers by default. While its not clear which ones are really needed, we decided to rather patch Android´s init to support the cpuset.* prefix, and just let the container mount a cgroup.cpuset controller in /dev/cpuset, the standard Android location.

Edited by Flo Lee

Merge request reports