* [PATCH] selftests: cgroup: Allow longer timeout for kmem_dead_cgroups cleanup
@ 2025-07-02 13:23 Sebastian Chlad
2025-07-12 17:35 ` Tejun Heo
0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Chlad @ 2025-07-02 13:23 UTC (permalink / raw)
To: cgroups; +Cc: Sebastian Chlad, Michal Koutny
The test_kmem_dead_cgroups test currently assumes that RCU and
memory reclaim will complete within 5 seconds. In some environments
this timeout may be insufficient, leading to spurious test failures.
This patch introduces max_time set to 20 which is then used in the
test. After 5th sec the debug message is printed to indicate the
cleanup is still ongoing.
In the system under test with 16 CPUs the original test was failing
most of the time and the cleanup time took usually approx. 6sec.
Further tests were conducted with and without do_rcu_barrier and the
results (respectively) are as follow:
quantiles 0 0.25 0.5 0.75 1
1 2 3 8 20 (mean = 4.7667)
3 5 8 8 20 (mean = 7.6667)
Acked-by: Michal Koutny <mkoutny@suse.com>
Signed-off-by: Sebastian Chlad <sebastian.chlad@suse.com>
---
tools/testing/selftests/cgroup/test_kmem.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/cgroup/test_kmem.c b/tools/testing/selftests/cgroup/test_kmem.c
index 96693d8772be..63b3c9aad399 100644
--- a/tools/testing/selftests/cgroup/test_kmem.c
+++ b/tools/testing/selftests/cgroup/test_kmem.c
@@ -308,6 +308,7 @@ static int test_kmem_dead_cgroups(const char *root)
char *parent;
long dead;
int i;
+ int max_time = 20;
parent = cg_name(root, "kmem_dead_cgroups_test");
if (!parent)
@@ -322,7 +323,7 @@ static int test_kmem_dead_cgroups(const char *root)
if (cg_run_in_subcgroups(parent, alloc_dcache, (void *)100, 30))
goto cleanup;
- for (i = 0; i < 5; i++) {
+ for (i = 0; i < max_time; i++) {
dead = cg_read_key_long(parent, "cgroup.stat",
"nr_dying_descendants ");
if (dead == 0) {
@@ -334,6 +335,8 @@ static int test_kmem_dead_cgroups(const char *root)
* let's wait a bit and repeat.
*/
sleep(1);
+ if (i > 5)
+ printf("Waiting time longer than 5s; wait: %ds (dead: %ld)\n", i, dead);
}
cleanup:
--
2.35.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] selftests: cgroup: Allow longer timeout for kmem_dead_cgroups cleanup
2025-07-02 13:23 [PATCH] selftests: cgroup: Allow longer timeout for kmem_dead_cgroups cleanup Sebastian Chlad
@ 2025-07-12 17:35 ` Tejun Heo
0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2025-07-12 17:35 UTC (permalink / raw)
To: Sebastian Chlad; +Cc: cgroups, Sebastian Chlad, Michal Koutny
On Wed, Jul 02, 2025 at 03:23:36PM +0200, Sebastian Chlad wrote:
> The test_kmem_dead_cgroups test currently assumes that RCU and
> memory reclaim will complete within 5 seconds. In some environments
> this timeout may be insufficient, leading to spurious test failures.
>
> This patch introduces max_time set to 20 which is then used in the
> test. After 5th sec the debug message is printed to indicate the
> cleanup is still ongoing.
>
> In the system under test with 16 CPUs the original test was failing
> most of the time and the cleanup time took usually approx. 6sec.
> Further tests were conducted with and without do_rcu_barrier and the
> results (respectively) are as follow:
> quantiles 0 0.25 0.5 0.75 1
> 1 2 3 8 20 (mean = 4.7667)
> 3 5 8 8 20 (mean = 7.6667)
>
> Acked-by: Michal Koutny <mkoutny@suse.com>
> Signed-off-by: Sebastian Chlad <sebastian.chlad@suse.com>
Applied to cgroup/for-6.17.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-07-12 17:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-02 13:23 [PATCH] selftests: cgroup: Allow longer timeout for kmem_dead_cgroups cleanup Sebastian Chlad
2025-07-12 17:35 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).