[LTP] [PATCH/RFC] tst_process_state_wait: wait for schedstats to settle when state == S

Cyril Hrubis chrubis@suse.cz
Thu Nov 7 12:39:29 CET 2019


Hi!
> hb->lock is locked at this point, and requeue takes it too, so I'm not
> sure what makes it fail. I've seen testcase fail in at least
> 2 different ways now. Here's the other one:

Looking at the test shouldn't we wait for the processes to be sleeping
after the futex_cmp_requeue() syscall?

i.e.

diff --git a/testcases/kernel/syscalls/futex/futex_cmp_requeue01.c b/testcases/kernel/syscalls/futex/futex_cmp_requeue01.c
index f5264c2ba..41f5e88a6 100644
--- a/testcases/kernel/syscalls/futex/futex_cmp_requeue01.c
+++ b/testcases/kernel/syscalls/futex/futex_cmp_requeue01.c
@@ -71,6 +71,9 @@ static void verify_futex_cmp_requeue(unsigned int n)
                        TST_RET, exp_ret);
        }

+       for (i = 0; i < tc->num_waiters; i++)
+               TST_PROCESS_STATE_WAIT(pid[i], 'S');
+
        num_requeues = futex_wake(&futexes[1], tc->num_waiters, 0);
        num_waits = futex_wake(&futexes[0], tc->num_waiters, 0);


-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list