Re: [RESEND PATCH v3] selftests/futex: fix the failed futex_requeue test issue

From: Andrew Morton

Date: Thu Apr 30 2026 - 19:43:30 EST


On Mon, 27 Apr 2026 18:18:38 +0800 Yuwen Chen <ywen.chen@xxxxxxxxxxx> wrote:

> This test item has extremely high requirements for timing and can only
> pass the test under specific conditions. The following situations will
> lead to test failure:
>
> MainThread Thread1
>
> pthread_create-------------------┐
> │ │
> futex_cmp_requeue │
> │ futex_wait
> │ │
>
> If the child thread is not waiting in the futex_wait function when the
> main thread reaches the futex_cmp_requeue function, the test will fail.

So you're saying that this test is generally flakey and annoying?

Yup, we would like to fix that.

> This patch avoids this problem by checking whether the child thread is
> in a sleeping state in the main thread.

Thanks!

AI review asked some questions, as it likes to do:
https://sashiko.dev/#/patchset/tencent_1BF14BBF2BBF088E3B609CC155EC7C206F05@xxxxxx