Add the executable 'test_memcontrol' to a .gitignore file.
Signed-off-by: Anders Roxell <[email protected]>
Signed-off-by: Shuah Khan (Samsung OSG) <[email protected]>
This commit adds tests for some of the core functionalities
of cgroups v2.
The commit adds tests for some core principles of croup V2 API:
- test_cgcore_internal_process_constraint
Tests internal process constraint.
You can't add a pid to a domain parent if a controller is enabled.
- test_cgcore_top_down_constraint_enable
Tests that you can't enable a controller on a child if it's not enabled
on the parent.
- test_cgcore_top_down_constraint_disable
Tests that you can't disable a controller on a parent if it's
enabled in a child.
- test_cgcore_no_internal_process_constraint_on_threads
Tests that there's no internal process constrain on threaded cgroups.
You can add threads/processes on a parent with a controller enabled.
- test_cgcore_parent_becomes_threaded
Tests that when a child becomes threaded the parent type becomes
domain threaded.
- test_cgcore_invalid_domain
In a situation like:
A (domain threaded) - B (threaded) - C (domain)
it tests that C can't be used until it is turned into a threaded cgroup.
The "cgroup.type" file will report "domain (invalid)" in these cases.
Operations which fail due to invalid topology use EOPNOTSUPP as the errno.
- test_cgcore_populated
In a situation like:
A(0) - B(0) - C(1)
\ D(0)
It tests that A, B and C's "populated" fields would be 1 while D's 0.
It tests that after the one process in C is moved to root, A,B and C's
"populated" fields would flip to "0" and file modified events will
be generated on the "cgroup.events" files of both cgroups.
Signed-off-by: Claudio Zumbo <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: Roman Gushchin <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: [email protected]
Acked-by: Tejun Heo <[email protected]>
Reviewed-by: Roman Gushchin <[email protected]>
Signed-off-by: Shuah Khan (Samsung OSG) <[email protected]>
"len" needs to be signed for the error handling to work.
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Shuah Khan (Samsung OSG) <[email protected]>
The test verifies that when there is active TCP connection, the
memory.stat.sock and memory.current values are close.
Signed-off-by: Mike Rapoport <[email protected]>
Acked-by: Roman Gushchin <[email protected]>
Signed-off-by: Shuah Khan (Samsung OSG) <[email protected]>
cg_name(const char *root, const char *name) is always called with
non-empty root and name arguments, so there is no sense in checking
it in the function body (after using in strlen()).
Signed-off-by: Roman Gushchin <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Shuah Khan (Samsung OSG) <[email protected]>
The new test verifies that memory.swap.max and memory.swap.current behave
as expected for simple allocation scenarios
Signed-off-by: Mike Rapoport <[email protected]>
Acked-by: Tejun Heo <[email protected]>
Acked-by: Roman Gushchin <[email protected]>
Signed-off-by: Shuah Khan (Samsung OSG) <[email protected]>
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 <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Acked-by: Tejun Heo <[email protected]>
Signed-off-by: Shuah Khan (Samsung OSG) <[email protected]>