cgroup: Add test_cpucg_weight_underprovisioned() testcase
authorDavid Vernet <void@manifault.com>
Fri, 22 Apr 2022 17:33:53 +0000 (10:33 -0700)
committerTejun Heo <tj@kernel.org>
Fri, 22 Apr 2022 18:39:32 +0000 (08:39 -1000)
commit4ab93063c83a2478863158799b027e9489ad4a40
tree6107a68676051921dd9f64e61bd16a52b79feb06
parent6376b22cd0a3455a534b6921b816ffab68ddc48f
cgroup: Add test_cpucg_weight_underprovisioned() testcase

test_cpu.c includes testcases that validate the cgroup cpu controller.
This patch adds a new testcase called test_cpucg_weight_underprovisioned()
that verifies that processes with different cpu.weight that are all running
on an underprovisioned system, still get roughly the same amount of cpu
time.

Because test_cpucg_weight_underprovisioned() is very similar to
test_cpucg_weight_overprovisioned(), this patch also pulls the common logic
into a separate helper function that is invoked from both testcases, and
which uses function pointers to invoke the unique portions of the
testcases.

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