[LTP] Question on .needs_cgroup_ctrls for cgroupv2

Richard Palethorpe rpalethorpe@suse.de
Mon Feb 27 16:52:59 CET 2023


Hello,

Cyril Hrubis <chrubis@suse.cz> writes:

> Hi!
>> So .needs_cgroup_ctrls can not used anymore for ONLY V2 case?
>> Since i encounter "tst_cgroup.c:848: TCONF: V2 'memory' controller
>> required, but it's mounted on V1" when i add ".needs_cgroup_ctrls =
>> (const char *const []){ "memory", NULL }".

You should see this works fine on Tumbleweed where pure V2 is the
default.

>
> Each controller can be mounted as V1 or as V2 but not both at the same
> time. It depends on how the system is booted, the default on most
> distributions is mixed V1 and V2 at the moment. If you want V2 system
> you have to reboot with systemd.unified_cgroup_hierarchy=1.

Yes that is the kernel command line option which you can add through
GRUB (unless I am mistaken).

Or it can be specified in the systemd configuration somewhere.

LTP does not try to remount CGroups if a controller is not on the
required version. If you need to test the unified hierarchy or a V2
controller then the simplest thing to do is configure systemd to only
use V2 (unified).

The exception is if the needed controller is not mounted already, then
LTP will mount it. This is the case if you, for e.g., use Rapido or some
buildroot config with CGroups in the kernel, but not userland.

-- 
Thank you,
Richard.


More information about the ltp mailing list