[PATCH 0/4] cgroup: Introduce cpu controller test suite

David Vernet posted 4 patches 4 years ago
There is a newer version of this series
tools/testing/selftests/cgroup/.gitignore    |   1 +
tools/testing/selftests/cgroup/Makefile      |   2 +
tools/testing/selftests/cgroup/cgroup_util.c |  12 +
tools/testing/selftests/cgroup/cgroup_util.h |   4 +
tools/testing/selftests/cgroup/test_cpu.c    | 416 +++++++++++++++++++
5 files changed, 435 insertions(+)
create mode 100644 tools/testing/selftests/cgroup/test_cpu.c
[PATCH 0/4] cgroup: Introduce cpu controller test suite
Posted by David Vernet 4 years ago
This patchset introduces a new test_cpu.c test suite as part of
tools/testing/selftests/cgroup. test_cpu.c will contain testcases that
validate the cgroup v2 cpu controller.

This patchset only contains testcases that validate cpu.stat and
cpu.weight, but I'm expecting to send further patchsets after this that
also include testcases that validate other knobs such as cpu.max.

Note that checkpatch complains about a missing MAINTAINERS file entry for
[PATCH 1/4], but Roman Gushchin added that entry in a separate patchset:
https://lore.kernel.org/all/20220415000133.3955987-4-roman.gushchin@linux.dev/.

David Vernet (4):
  cgroup: Add new test_cpu.c test suite in cgroup selftests
  cgroup: Add test_cgcpu_stats() testcase to cgroup cpu selftests
  cgroup: Add test_cgcpu_weight_overprovisioned() testcase
  cgroup: Add new test_cgcpu_weight_underprovisioned() testcase

 tools/testing/selftests/cgroup/.gitignore    |   1 +
 tools/testing/selftests/cgroup/Makefile      |   2 +
 tools/testing/selftests/cgroup/cgroup_util.c |  12 +
 tools/testing/selftests/cgroup/cgroup_util.h |   4 +
 tools/testing/selftests/cgroup/test_cpu.c    | 416 +++++++++++++++++++
 5 files changed, 435 insertions(+)
 create mode 100644 tools/testing/selftests/cgroup/test_cpu.c

-- 
2.30.2
Re: [PATCH 0/4] cgroup: Introduce cpu controller test suite
Posted by Tejun Heo 4 years ago
Hello,

On Tue, Apr 19, 2022 at 02:32:40PM -0700, David Vernet wrote:
> This patchset introduces a new test_cpu.c test suite as part of
> tools/testing/selftests/cgroup. test_cpu.c will contain testcases that
> validate the cgroup v2 cpu controller.
> 
> This patchset only contains testcases that validate cpu.stat and
> cpu.weight, but I'm expecting to send further patchsets after this that
> also include testcases that validate other knobs such as cpu.max.
> 
> Note that checkpatch complains about a missing MAINTAINERS file entry for
> [PATCH 1/4], but Roman Gushchin added that entry in a separate patchset:
> https://lore.kernel.org/all/20220415000133.3955987-4-roman.gushchin@linux.dev/.

This looks great to me. A few small things:

* Can you please repost w/ Ingo and Peterz cc'd?

* Maybe cpucg instead of cgcpu?

* Single level testing is great but extending the case to cover deeper
  nesting level would be great. ie. a test case with multi level tree w/
  both under and over provisioned parts in the tree.

Thanks.

-- 
tejun
Re: [PATCH 0/4] cgroup: Introduce cpu controller test suite
Posted by David Vernet 4 years ago
Hi Tejun,

On Thu, Apr 21, 2022 at 12:21:18PM -1000, Tejun Heo wrote:
> * Can you please repost w/ Ingo and Peterz cc'd?

Will do, I'll cc them on v2.

> * Maybe cpucg instead of cgcpu?

Agreed, that seems more intuitive. I'll change it in v2.

> * Single level testing is great but extending the case to cover deeper
>   nesting level would be great. ie. a test case with multi level tree w/
>   both under and over provisioned parts in the tree.

This sounds like a great idea. I have another patch set that I was planning
to send out which adds a few more testcases. I can include some testcases
in that set which validate more complicated nesting setups.

Thanks,
David