[LTP] [PATCH v2 0/5] Add memcontrol03 and declarative CG API

Richard Palethorpe rpalethorpe@suse.com
Thu Feb 3 09:18:14 CET 2022


This adds a third test from the kselftests. Also I have finally taken
the step of moving the CGroup configuration to tst_test and making it
declarative. Since V2 of the patch this does save a lot of typing and
removes the need to remember to call cleanup. It also puts the CGroup
info into the metadata.

V2:
* Updated docs
* Updated library tests
* Moved the test/drain cg ptr out of the test struct and allocate
  it statically. This resulted in some overly clever init code
  being removed as well.
* Renamed parent cgs to trunk and child to leaf as technically trunk
  nodes can be both parents and children.
* Matched the cg names in the comments with the variable names
  using enums. So it's easier to see that the description matches
  the code.
* Use waitpid as suggested by Cyril and remove the patch adding
  tst_reap_child.
* unlink the tmpfile to hopefully prevent random storage full errors
  when using -i. We already seek to 0.
* init the fd to -1
* Make tst_cgroup_group_mk sprintf like as suggested by Cyril.

Richard Palethorpe (5):
  memcontrol: Lift out some common definitions into a shared header
  API/cgroup: Declare required controllers and version in test struct
  API/cgroup: Add memory.min
  API/cgroup: Make tst_cgroup_group_mk sprintf like
  memcontrol03: Copy from kselftest

 doc/c-test-api.txt                            | 101 ++++---
 include/tst_cgroup.h                          |  38 ++-
 include/tst_test.h                            |  14 +
 lib/newlib_tests/tst_cgroup01.c               |   2 +-
 lib/newlib_tests/tst_cgroup02.c               |  26 +-
 lib/tst_cgroup.c                              |  87 +++---
 lib/tst_test.c                                |  22 ++
 runtest/controllers                           |   1 +
 testcases/kernel/controllers/memcg/.gitignore |   1 +
 .../kernel/controllers/memcg/memcontrol01.c   |  19 +-
 .../kernel/controllers/memcg/memcontrol02.c   |  45 +---
 .../kernel/controllers/memcg/memcontrol03.c   | 255 ++++++++++++++++++
 .../controllers/memcg/memcontrol_common.h     |  48 ++++
 testcases/kernel/mem/cpuset/cpuset01.c        |  25 +-
 testcases/kernel/mem/ksm/ksm02.c              |  19 +-
 testcases/kernel/mem/ksm/ksm03.c              |  13 +-
 testcases/kernel/mem/ksm/ksm04.c              |  16 +-
 testcases/kernel/mem/oom/oom03.c              |  24 +-
 testcases/kernel/mem/oom/oom04.c              |  15 +-
 testcases/kernel/mem/oom/oom05.c              |  34 ++-
 .../sched/cfs-scheduler/cfs_bandwidth01.c     |  10 +-
 testcases/kernel/syscalls/madvise/madvise06.c |  28 +-
 22 files changed, 540 insertions(+), 303 deletions(-)
 create mode 100644 testcases/kernel/controllers/memcg/memcontrol03.c
 create mode 100644 testcases/kernel/controllers/memcg/memcontrol_common.h

-- 
2.34.1



More information about the ltp mailing list