aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/cgroup/test_memcontrol.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-04-08selftests: cgroup: fix cleanup path in test_memcg_subtree_control()Roman Gushchin1-17/+21
Dan reported, that cleanup path in test_memcg_subtree_control() triggers a static checker warning: ./tools/testing/selftests/cgroup/test_memcontrol.c:76 \ test_memcg_subtree_control() error: uninitialized symbol 'child2'. Fix this by initializing child2 and parent2 variables and split the cleanup path into few stages. Signed-off-by: Roman Gushchin <guro@fb.com> Fixes: 84092dbcf901 ("selftests: cgroup: add memory controller self-tests") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Cc: Shuah Khan (Samsung OSG) <shuah@kernel.org> Cc: Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by: Shuah Khan <shuah@kernel.org>
2018-09-07Add tests for memory.oom.groupJay Kamat1-0/+205
Add tests for memory.oom.group for the following cases: - Killing all processes in a leaf cgroup, but leaving the parent untouched - Killing all processes in a parent and leaf cgroup - Keeping processes marked by OOM_SCORE_ADJ_MIN alive when considered for being killed by the group oom killer. Signed-off-by: Jay Kamat <jgkamat@fb.com> Acked-by: Roman Gushchin <guro@fb.com> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: cgroup/memcontrol: add basic test for socket accountingMike Rapoport1-0/+193
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 <rppt@linux.vnet.ibm.com> Acked-by: Roman Gushchin <guro@fb.com> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: cgroup/memcontrol: add basic test for swap controlsMike Rapoport1-0/+91
The new test verifies that memory.swap.max and memory.swap.current behave as expected for simple allocation scenarios Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com> Acked-by: Tejun Heo <tj@kernel.org> Acked-by: Roman Gushchin <guro@fb.com> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-05-30selftests: cgroup: add memory controller self-testsRoman Gushchin1-0/+731
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>