memcg/memcontrol05: add cgroup v2 task migration charge accounting test
PATCH v8 1/1 memcg/memcontrol05: add cgroup v2 task migration charge accounting test
Verify that in cgroup v2, memory charges remain pinned to the cgroup that allocated them when a task migrates, and that new allocations after migration are charged to the destination cgroup.
---
v7 -> v8:
- use values_close() for post-migration baseline check
- check after_alloc2 >= ALLOC_SIZE2 for destination charge
Link to v7: https://lore.kernel.org/ltp/[email protected]/
--- runtest/controllers | 1 + testcases/kernel/controllers/memcg/.gitignore | 1 + .../kernel/controllers/memcg/memcontrol05.c | 161 ++++++++++++++++++ 3 files changed, 163 insertions(+) create mode 100644 testcases/kernel/controllers/memcg/memcontrol05.c
runtest/controllers +1 -0
@@ -24,6 +24,7 @@ memcontrol01 memcontrol01 memcontrol02 memcontrol02 memcontrol03 memcontrol03 memcontrol04 memcontrol04 +memcontrol05 memcontrol05 cgroup_fj_function_debug cgroup_fj_function.sh debug cgroup_fj_function_cpuset cgroup_fj_function.sh cpuset
testcases/kernel/controllers/memcg/.gitignore +1 -0
@@ -9,3 +9,4 @@ memcontrol01 memcontrol02 memcontrol03 memcontrol04 +memcontrol05
testcases/kernel/controllers/memcg/memcontrol05.c new file +161 -0
161 lines not on this page · raw message
Signature · 5 lines
2.56.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Pavithra,
Quoted 1 line · Pavithra
memcg/memcontrol05: add cgroup v2 task migration charge accounting test
Verdict - Reviewed
---
Note:
The agent can sometimes produce false positives although often its findings are genuine. If you find issues with the review, please comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hello.
Quoted 3 lines · Pavithra
Verify that in cgroup v2, memory charges remain pinned to the cgroup that allocated them when a task migrates, and that new allocations after migration are charged to the destination cgroup.
The staticness of memory charges is "non-functional" feature of cgroup v2. Could you explain more the real word motivation behind this case?
(Each such testcase is subject to noise and it's good to understand what/why are the expectations.)
Thanks,
Michal
Signature · 2 lines
-- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 8 lines · Michal Koutný
Hello.
Quoted 3 lines · Pavithra
Verify that in cgroup v2, memory charges remain pinned to the cgroup that allocated them when a task migrates, and that new allocations after migration are charged to the destination cgroup.
Quoted 8 lines
The staticness of memory charges is "non-functional" feature of cgroup v2. Could you explain more the real word motivation behind this case?
(Each such testcase is subject to noise and it's good to understand what/why are the expectations.)
Thanks,
Michal
Hi Michal,
Thanks for the inputs, basically trying to migrate testcases/kernel/controllers/memctl/ test to cgroupv2 Depending on its applicability to v2, we can determine whether to proceed with this patch.
Thanks,
Pavithra
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 2 lines · pavrampu
Thanks for the inputs, basically trying to migrate testcases/kernel/controllers/memctl/ test to cgroupv2
Aha, that context wasn't clear to me from the message.
It'd make sense (to me) to include removal of the migrated test in the series.
Quoted 2 lines
Depending on its applicability to v2, we can determine whether to proceed with this patch.
v2 doesn't have the memory.move_charge_at_immigrate switch, so it can only test the implicit behavior of charging in v2. With such tests, I'm always worried that it'd detect noise in test environment rather than memcg bug (what could it be?).
From practical experience, more useful would be a test that checks that charge reparenting [1] eventually happens (without any pins).
HTH,
Michal
[1] You can think of it like migration from child->parent after rmdir child (so that in-kernel child memcg can be truly gone, cgroup.stat:nr_dying_subsys_memory)). The challenge is that it is quite asynchronous (again noisy) but at the moment I'd assess the impact of such bugs more relevant to encountered bugs.
Signature · 2 lines
-- Mailing list info: https://lists.linux.it/listinfo/ltp