diff options
| author | Guopeng Zhang <zhangguopeng@kylinos.cn> | 2025-12-03 19:56:31 +0800 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2025-12-08 08:44:54 -1000 |
| commit | 50133c09d189a26f4cc6e78e382864fd599a1dc4 (patch) | |
| tree | 1d3dce35da6a642acf74d8e50c488581d9f26187 /tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git | |
| parent | 6360d444ae32871c6a048ac880ef3b871a439bad (diff) | |
selftests: cgroup: Replace sleep with cg_read_key_long_poll() for waiting on nr_dying_descendants
Replace the manual sleep-and-retry logic in test_kmem_dead_cgroups()
with the new helper `cg_read_key_long_poll()`. This change improves
the robustness of the test by polling the "nr_dying_descendants"
counter in `cgroup.stat` until it reaches 0 or the timeout is exceeded.
Additionally, increase the retry timeout to 8 seconds (from 5 seconds)
based on testing results:
- With 5-second timeout: 4/20 runs passed.
- With 8-second timeout: 20/20 runs passed.
The 8 second timeout is based on stress testing of test_kmem_dead_cgroups()
under load: 5 seconds was occasionally not enough for reclaim of dying
descendants to complete, whereas 8 seconds consistently covered the observed
latencies. This value is intended as a generous upper bound for the
asynchronous reclaim and is not tied to any specific kernel constant, so it
can be adjusted in the future if reclaim behavior changes.
Signed-off-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
Reviewed-by: Shakeel Butt <shakeel.butt@linux.dev>
Acked-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
