selftests: cgroup: add memory controller self-tests
authorRoman Gushchin <guro@fb.com>
Fri, 11 May 2018 18:03:49 +0000 (19:03 +0100)
committerShuah Khan (Samsung OSG) <shuah@kernel.org>
Wed, 30 May 2018 21:29:06 +0000 (15:29 -0600)
commit84092dbcf90176fcc258d74ad6ae8bb28d7df31a
tree2ef5aa1a3452234f8c2a913c752f1fc9ee2018dc
parent8eecdd4d040233daacfde20d0f5c7191c9125e17
selftests: cgroup: add memory controller self-tests

Cgroups are used for controlling the physical resource distribution
(memory, CPU, io, etc) and often are used as basic building blocks
for large distributed computing systems. Even small differences
in the actual behavior may lead to significant incidents.

The codebase is under the active development, which will unlikely
stop at any time soon. Also it's scattered over different kernel
subsystems, which makes regressions more probable.

Given that, the lack of any tests is crying.

This patch implements some basic tests for the memory controller,
as well as a minimal required framework. It doesn't pretend for a
very good coverage, but pretends to be a starting point.

Hopefully, any following significant changes will include corresponding
tests.

Tests for CPU and io controllers, as well as cgroup core
are next in the todo list.

Signed-off-by: Roman Gushchin <guro@fb.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: kernel-team@fb.com
Cc: linux-kselftest@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
tools/testing/selftests/Makefile
tools/testing/selftests/cgroup/Makefile [new file with mode: 0644]
tools/testing/selftests/cgroup/cgroup_util.c [new file with mode: 0644]
tools/testing/selftests/cgroup/cgroup_util.h [new file with mode: 0644]
tools/testing/selftests/cgroup/test_memcontrol.c [new file with mode: 0644]