Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Yuwen Chen <ywen.chen@foxmail.com>
To: bigeasy@linutronix.de
Cc: akpm@linux-foundation.org, andrealmeid@igalia.com,
	colin.i.king@gmail.com, dave@stgolabs.net, dvhart@infradead.org,
	edliaw@google.com, justinstitt@google.com,
	kernel-team@android.com, licayy@foxmail.com,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	luto@mit.edu, mingo@redhat.com, morbo@google.com,
	nathan@kernel.org, ndesaulniers@google.com, peterz@infradead.org,
	shuah@kernel.org, tglx@kernel.org, usama.anjum@collabora.com,
	wakel@google.com, ywen.chen@foxmail.com
Subject: Re: [RESEND PATCH v3] selftests/futex: fix the failed futex_requeue test issue
Date: Wed, 29 Apr 2026 09:40:54 +0800	[thread overview]
Message-ID: <tencent_510ADC6BE374AEF5E77979785F025D314508@qq.com> (raw)
In-Reply-To: <20260428105801.dwKmqgaQ@linutronix.de>

On Tue, 28 Apr 2026 12:58:01 +0200, Sebastian Andrzej Siewior wrote:

>> This patch avoids this problem by checking whether the child thread is

>This patch.

Sorry, I haven't submitted patches many times.

> The pthread_barrier you introduced is not enough?
> You also increase the wait-timeout to 3s and parse the wait function.
> You could describe what the expectation here is. I would assume that the
> barrier on its own should be enough. But the barrier and the state
> parsing is a bit much. This makes me curious what is so special on your
> side that it does not work as-is. Is this some big-little case where the
> big creates the thread and does requeue while the littke is supposed to
> do futex_wait but falls behind?

Originally, I also thought that using pthread_barrier would be sufficient.
However, according to the actual tests on our platform, it's not enough.
After adding pthread_barrier, the problem occurs even more frequently.

Based on my speculation and actual tests, using pthread_barrier still cannot
guarantee that the child threads will reach the futex_wait stage.

>> +	EXPECT_EQ(0, futex_thread_create(&waiter, waiterfn, NULL));

> Why this ASSERT_EQ -> EXPECT_EQ ?

Sorry, ASSERT_EQ should indeed be used here. When thread creation fails,
the subsequent execution should be stopped directly.

>> -	pthread_t waiter[10];
>> -	int i;
>> +	struct futex_thread waiter[10];

> Couldn't that `i# remain where it was and that waiter moved as per Xmas
> notation?

Of course. Thank you very much for your suggestions.

My native language is Chinese. I can't perceive the subtle changes in various
expressions. Please forgive me if there is something inappropriate in my tone
of expression.

Meanwhile, I'd also be very glad if you could help make some modifications.
I've just joined the community and there are still many things I don't understand.

The following link is an earlier version of this patch:
https://lore.kernel.org/all/tencent_35CFB8AE9D4BE7917D95763D15B972638C0A@qq.com/

yuwen


  reply	other threads:[~2026-04-29  1:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-28  7:16 [PATCH v3] selftests/futex: fix the failed futex_requeue test issue Yuwen Chen
2026-04-27 10:18 ` [RESEND PATCH " Yuwen Chen
2026-04-28 10:58   ` Sebastian Andrzej Siewior
2026-04-29  1:40     ` Yuwen Chen [this message]
2026-04-30 23:41   ` Andrew Morton
2026-05-06  3:35     ` Yuwen Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_510ADC6BE374AEF5E77979785F025D314508@qq.com \
    --to=ywen.chen@foxmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrealmeid@igalia.com \
    --cc=bigeasy@linutronix.de \
    --cc=colin.i.king@gmail.com \
    --cc=dave@stgolabs.net \
    --cc=dvhart@infradead.org \
    --cc=edliaw@google.com \
    --cc=justinstitt@google.com \
    --cc=kernel-team@android.com \
    --cc=licayy@foxmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=luto@mit.edu \
    --cc=mingo@redhat.com \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=peterz@infradead.org \
    --cc=shuah@kernel.org \
    --cc=tglx@kernel.org \
    --cc=usama.anjum@collabora.com \
    --cc=wakel@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox