Skip to content

Add memcontrol03 and declarative CG API

Richard Palethorpe via ltp ltp 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 8 repliesIn review
  2. v25 patches 14 repliesSuperseded
  3. v16 patches 4 repliesSuperseded

Changes in v3 from the cover letter

* Simplify by adding tst_cgroup.h to tst_test.h as suggested by Li Wang
* rm options defaults as suggested by Li
* use abbreviation for controller, same as version as suggesdted by Li
* rm useless checks for V1 in memcontrol03 as suggested by Cyril
* fix format compile error in cfs_bandwidth01 as reported by Li
* Move the group_name fix into the printf patch; reported by Cyril

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5memcontrol: Lift out some common definitions into a shared headertestcases/kernel/controllers/memcg/memcontrol02.c testcases/kernel/controllers/memcg/memcontrol_common.h+49 -310 replies
2/5API/cgroup: Declare required controllers and version in test structdoc/c-test-api.txt include/tst_cgroup.h include/tst_test.h +17 more+209 -2604 replies
3/5API/cgroup: Add memory.minlib/tst_cgroup.c+1 -01 reply
4/5API/cgroup: Make tst_cgroup_group_mk sprintf likeinclude/tst_cgroup.h lib/tst_cgroup.c testcases/kernel/sched/cfs-scheduler/cfs_bandwidth01.c+21 -242 replies
5/5memcontrol03: Copy from kselftestruntest/controllers testcases/kernel/controllers/memcg/.gitignore testcases/kernel/controllers/memcg/memcontrol03.c+255 -01 reply

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchCyril HrubisLi Wang
1/5R-b R-b
2/5R-b R-b
3/5R-b R-b
4/5R-b R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [LTP] [PATCH v3 0/5] Add memcontrol03 and declarative CG API

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.

V3:
* Simplify by adding tst_cgroup.h to tst_test.h as suggested by Li Wang
* rm options defaults as suggested by Li
* use abbreviation for controller, same as version as suggesdted by Li
* rm useless checks for V1 in memcontrol03 as suggested by Cyril
* fix format compile error in cfs_bandwidth01 as reported by Li
* Move the group_name fix into the printf patch; reported by Cyril

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                            | 102 ++++---
 include/tst_cgroup.h                          |  34 +--
 include/tst_test.h                            |   7 +
 lib/newlib_tests/tst_cgroup01.c               |   3 +-
 lib/newlib_tests/tst_cgroup02.c               |  27 +-
 lib/tst_cgroup.c                              |  91 ++++---
 lib/tst_test.c                                |  21 ++
 runtest/controllers                           |   1 +
 testcases/kernel/controllers/memcg/.gitignore |   1 +
 .../kernel/controllers/memcg/memcontrol01.c   |  20 +-
 .../kernel/controllers/memcg/memcontrol02.c   |  45 +---
 .../kernel/controllers/memcg/memcontrol03.c   | 253 ++++++++++++++++++
 .../controllers/memcg/memcontrol_common.h     |  47 ++++
 testcases/kernel/mem/cpuset/cpuset01.c        |  25 +-
 testcases/kernel/mem/include/mem.h            |   1 -
 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     |  20 +-
 testcases/kernel/syscalls/madvise/madvise06.c |  29 +-
 23 files changed, 534 insertions(+), 314 deletions(-)
 create mode 100644 testcases/kernel/controllers/memcg/memcontrol03.c
 create mode 100644 testcases/kernel/controllers/memcg/memcontrol_common.h
Signature · 5 lines
2.34.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp