cgroup: Add test_cpucg_weight_overprovisioned() testcase
authorDavid Vernet <void@manifault.com>
Fri, 22 Apr 2022 17:33:52 +0000 (10:33 -0700)
committerTejun Heo <tj@kernel.org>
Fri, 22 Apr 2022 18:39:32 +0000 (08:39 -1000)
commit6376b22cd0a3455a534b6921b816ffab68ddc48f
treeeffbe15726c30e72f53f338f1fb36051406fe917
parent3c879a1bb88792c05c2dd6a957423838b2830d73
cgroup: Add test_cpucg_weight_overprovisioned() testcase

test_cpu.c includes testcases that validate the cgroup cpu controller.
This patch adds a new testcase called test_cpucg_weight_overprovisioned()
that verifies the expected behavior of creating multiple processes with
different cpu.weight, on a system that is overprovisioned.

So as to avoid code duplication, this patch also updates cpu_hog_func_param
to take a new hog_clock_type enum which informs how time is counted in
hog_cpus_timed() (either process time or wall clock time).

Signed-off-by: David Vernet <void@manifault.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
tools/testing/selftests/cgroup/cgroup_util.c
tools/testing/selftests/cgroup/cgroup_util.h
tools/testing/selftests/cgroup/test_cpu.c