memcg/memcontrol0[34]: Align with the kselftest protection model
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 6 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | memcg/memcontrol0[34]: Use expected values from the protection modeltestcases/ testcases/ | +14 | 3 replies | |
| 2/2 | memcg/memcontrol0[34]: Remove protection from the top level grouptestcases/ testcases/ | +4 | 2 replies |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Wei Gao | Michal Koutný |
|---|---|---|
| 1/2 | R-b | R-b |
| 2/2 | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [LTP] [PATCH 0/2] memcg/memcontrol0[34]: Align with the kselftest protection model
From: Sebastian Chlad <[email protected]>
memcontrol03 (memory.min) and memcontrol04 (memory.low) were ported from the kselftest test_memcontrol.c in 2022, but they still follow the 2018 version of it. The kselftest has since reworked this exact test three times, and none of that reached LTP:
- f10b6e9a8e66 ("selftests: memcg: adjust expected reclaim values of protected cgroups") replaced the hand-picked A/B/C ~= 33M and A/B/D ~= 17M with values from a simulation of the kernel's protection distribution (memcg_protection.m): 29M and 21M.
- 6a35919005d4 ("selftests: memcg: remove protection from top level memcg") dropped memory.min/memory.low on A, which has no effect since A is the reclaim root.
- d2def68ae06a ("selftests: memcg: increase error tolerance of child memory.current check in test_memcg_protection()") widened the tolerances to 15% (C) and 20% (D) because of sporadic failures.
The first one is what matters here. Kernels behave as the model says, so D ends up close to 21M and sits right at the edge of the old 17M +/- 20% range. On x86_64 D was at ~90% of the upper limit in every run, and small variations in reclaim are enough to fail it. With the model values both C and D sit in the middle of their ranges (~8M of margin each, 50+ iterations per test). LTP's tolerance is already 20% for both, so the third commit needs no change.
Patch 1 updates the expected values, patch 2 removes the top level protection. Both apply to memcontrol03 and memcontrol04.
This does not make every failure go away. On ppc64le we also see runs where the most protected group C is reclaimed down to a few MB while the unprotected A/B/F keeps its pagecache. That is protection working the wrong way round, not a tolerance problem, and the tests should keep reporting it.
Sebastian Chlad (2):
memcg/memcontrol0[34]: Use expected values from the protection model memcg/memcontrol0[34]: Remove protection from the top level group
.../kernel/controllers/memcg/memcontrol03.c | 18 +++++++++--------- .../kernel/controllers/memcg/memcontrol04.c | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-)
Signature · 5 lines
2.51.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp