Closed smayasomesh closed 1 year ago
Looking at kernel sources it looks like cpuset purposely exposes minimal interface in the V2 hierarchy, so I suppose the best course of action is to skip the cpu_exclusive tests if we are on v2 cpuset controller.
Can I go ahead with the patch to skip this test if cgroup v2 cpuset controllers are found?
@Sowmya-Indranna ideally the test should be fixed to return TCONF instead of TBROK.
tested this patch to skip if the cgroup is V2. Please check and confirm if this looks fine.
In cpuset/cpuset_regression_test.sh
setup() { cgroup_require "cpuset" cgroup_version=$(cgroup_get_version "cpuset") root_cpuset_dir=$(cgroup_get_mountpoint "cpuset") testpath=$(cgroup_get_test_path "cpuset") task_list=$(cgroup_get_task_list "cpuset") tst_res TINFO "test starts with cgroup version $cgroup_version"
**if [ "$cgroup_version" = "2" ]; then
tst_res TINFO "Controller mounted on cgroup2 hierarchy, skipping test"
return
fi**
if ! [ -f ${root_cpuset_dir}/${cpu_exclusive} ]; then
cpu_exclusive=cpu_exclusive
cpus=cpus
fi
do_test() { local cpu_exclusive_tmp cpus_value ROD_SILENT mkdir ${root_cpuset_dir}/testdir
**if [ "$cgroup_version" = "2" ]; then
tst_res TCONF "Cgroup v2 found, skipping test"
return
fi**
# Creat an exclusive cpuset.
echo 1 > ${root_cpuset_dir}/testdir/${cpu_exclusive}
[ $? -ne 0 ] && tst_brk TFAIL "'echo 1 > ${root_cpuset_dir}/testdir/${cpu_exclusive}' failed"
tested the results across cgroup version:
if cgroup version is 2 then the results achieved is
Running tests.......
<<
Summary:
passed 0
failed 0
broken 0
skipped 1
warnings 0
<<
if the cgroup version is 1
Running tests.......
<<
Summary:
passed 1
failed 0
broken 0
skipped 0
warnings 0
<<
Request to review
Awaiting review for this to return TCONF instead of TBRK if the cgroup version is 2
@metan-ucw - please review the above fix to return TCONF if its cgroup version2
@Sowmya-Indranna we can just do tst_brk TCONF "..."
in the test setup, no need to touch the do_test()
. Can you please send a patch to the mailing list?
setup() { cgroup_require "cpuset" cgroup_version=$(cgroup_get_version "cpuset") root_cpuset_dir=$(cgroup_get_mountpoint "cpuset") testpath=$(cgroup_get_test_path "cpuset") task_list=$(cgroup_get_task_list "cpuset")
tst_res TINFO "test starts with cgroup version $cgroup_version"
**if [ "$cgroup_version" = "2" ]; then
tst_brk TCONF "Cgroup v2 found, skipping test"
return
fi**
if ! [ -f ${root_cpuset_dir}/${cpu_exclusive} ]; then
cpu_exclusive=cpu_exclusive
cpus=cpus
fi
sending the patch for the mailing list
Results:
tag=cpuset_regression_test stime=1683873223
cmdline="cpuset_regression_test.sh"
contacts=""
analysis=exit
<<
Summary:
passed 0
failed 0
broken 0
skipped 1
warnings 0
<<
patch sent to the mailing list
cputest_regression_test fails with error: Both cpuset.cpu_exclusive and cpu_exclusive do not exist in rhel9
./runltp -f controllers -s cpuset_regression_test
Error: cpuset_regression_test 1 TBROK: Both cpuset.cpu_exclusive and cpu_exclusive do not exist
Summary: passed 0 failed 0 broken 1 skipped 0 warnings 0 <<>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=2 corefile=no
cutime=6 cstime=3
<<>>
INFO: ltp-pan reported some tests FAIL
LTP Version: 20230127
cat /sys/gs/cgroup - wherein cpuset doesnt exist. However created it manually
mount | grep group cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
cat /sys/fs/cgroup/cgroup.controllers cpuset cpu io memory hugetlb pids rdma misc
cat /proc/filesystems | grep cpuset nodev cpuset
cd /sys/fs/cgroup ls cgroup.controllers cpuset.mems.effective memory.stat cgroup.max.depth cpu.stat misc.capacity cgroup.max.descendants dev-hugepages.mount proc-fs-nfsd.mount cgroup.procs dev-mqueue.mount proc-sys-fs-binfmt_misc.mount cgroup.stat init.scope sys-fs-fuse-connections.mount cgroup.subtree_control io.pressure sys-kernel-config.mount cgroup.threads io.stat sys-kernel-debug.mount cpu.pressure memory.numa_stat sys-kernel-tracing.mount cpuset memory.pressure system.slice cpuset.cpus.effective memory.reclaim user.slice
where in still cpu_exclusive doesnot exist
cat /proc/filesystems | grep cpuset nodev cpuset