[LTP] [RFC PATCH] tst_cgroup: Avoid mixing mounts V1 and V2 simultaneously

Li Wang liwang@redhat.com
Fri Apr 28 15:30:21 CEST 2023


On Fri, Apr 28, 2023 at 9:12 PM Cyril Hrubis <chrubis@suse.cz> wrote:

> Hi!
> > That's the original design. We tried to keep flexible but ignored
> > one exception V1 mounts all controllers and V2 only basic mount.
> > (No controllers conflict in this mounting).
> >
> > From my observation, if a system(e.g. RHEL8) only announces
> > Cgroup V1 support but does not guarantee V2 to be used.
> > A test required 'CTRL_BASE' could mount V2 success but
> > that V2 is only part work and test will get TBROK.
> > We are unable to say this situation is a bug.
>
> So the V2 does not actually work unless there is at least one controller
> enabled? That sounds like a bug to me, my system actually uses v1
> controllers and unified hierarchy at the same time. The unified
> hierarchy is used to group deamon processes and kill them with the
> cgropu.kill if needed.


Hmm, let me investigate...

>
> What exactly happens on your system?
>

When mounting V1 with all controllers and only the basic of V2,
there lack of some controller files (cgroup.kill) in V2.

# mount | grep cgroup
tmpfs on /sys/fs/cgroup type tmpfs
(ro,nosuid,nodev,noexec,seclabel,size=1813984k,nr_inodes=453496,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup
(rw,nosuid,nodev,noexec,relatime,seclabel,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/perf_event type cgroup
(rw,nosuid,nodev,noexec,relatime,seclabel,perf_event)
cgroup on /sys/fs/cgroup/devices type cgroup
(rw,nosuid,nodev,noexec,relatime,seclabel,devices)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup
(rw,nosuid,nodev,noexec,relatime,seclabel,net_cls,net_prio)
cgroup on /sys/fs/cgroup/pids type cgroup
(rw,nosuid,nodev,noexec,relatime,seclabel,pids)
cgroup on /sys/fs/cgroup/rdma type cgroup
(rw,nosuid,nodev,noexec,relatime,seclabel,rdma)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup
(rw,nosuid,nodev,noexec,relatime,seclabel,cpu,cpuacct)
cgroup on /sys/fs/cgroup/hugetlb type cgroup
(rw,nosuid,nodev,noexec,relatime,seclabel,hugetlb)
cgroup on /sys/fs/cgroup/cpuset type cgroup
(rw,nosuid,nodev,noexec,relatime,seclabel,cpuset)
cgroup on /sys/fs/cgroup/freezer type cgroup
(rw,nosuid,nodev,noexec,relatime,seclabel,freezer)
cgroup on /sys/fs/cgroup/memory type cgroup
(rw,nosuid,nodev,noexec,relatime,seclabel,memory)
cgroup on /sys/fs/cgroup/blkio type cgroup
(rw,nosuid,nodev,noexec,relatime,seclabel,blkio)
cgroup2 on /tmp/cgroup_unified type cgroup2
(rw,relatime,seclabel,memory_recursiveprot)
# cd /tmp/cgroup_unified/
# ls
cgroup.controllers  cgroup.max.depth  cgroup.max.descendants  cgroup.procs
 cgroup.stat  cgroup.subtree_control  cgroup.threads  cpu.pressure
 cpu.stat  io.pressure  ltp  memory.pressure

# cd ltp/
# ls
cgroup.controllers  cgroup.events  cgroup.freeze  cgroup.max.depth
 cgroup.max.descendants  cgroup.procs  cgroup.stat  cgroup.subtree_control
 cgroup.threads  cgroup.type  cpu.pressure  cpu.stat  drain  io.pressure
 memory.pressure  test-41592


-- 
Regards,
Li Wang


More information about the ltp mailing list