public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/2] selftests/futex: fix the failed futex_requeue test
@ 2026-02-05  2:00 Yuwen Chen
  2026-02-05  2:08 ` [PATCH v5 1/2] selftests/futex: implement the interfaces related to threads Yuwen Chen
  2026-02-05  2:09 ` [PATCH v5 2/2] selftests/futex: fix the failed futex_requeue test issue Yuwen Chen
  0 siblings, 2 replies; 7+ messages in thread
From: Yuwen Chen @ 2026-02-05  2:00 UTC (permalink / raw)
  To: tglx
  Cc: ywen.chen, akpm, andrealmeid, bigeasy, colin.i.king, dave, dvhart,
	edliaw, justinstitt, kernel-team, licayy, linux-kernel,
	linux-kselftest, luto, mingo, morbo, nathan, ndesaulniers, peterz,
	shuah, usama.anjum, wakel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 1753 bytes --]

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.

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

v1->v2:
    1. Fix the issue of abnormal use of fscanf in the get_thread_state function
    2. Add timeout logic

v2->v3: https://lore.kernel.org/all/tencent_B9DBF2ECBE56BAB68BDAB949C6935D01CE09@qq.com/
    1. Use /proc/[pid]/wchan instead of /proc/[pid]/stat to check if a process has entered the sleep state
    2. Refactor part of the logic to facilitate code reuse.

v3->v4: https://lore.kernel.org/all/tencent_FC5FB35D2545AFDCA6E377AE4DE75C79AF08@qq.com/
    1. Add a new futex_thread.h file.
    2. Add a new function named futex_thread_destroy.
    3. Fix the issue that threads are not reclaimed in futex_requeue.

v4->v5: https://lore.kernel.org/all/tencent_204540DCC2E303AEB6E77679C05F5C5D3808@qq.com/
    1. Split the patch into two.
    2. Modify the thread interface to support returning error codes.
    3. In the test cases, check the return values of the threads.
    4. Modify the macro definitions to more understandable names.
    5. When failing to open the /proc/%d/wchan file, delay for 100 ms.
    6. Modify the parameter description of the interface.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v5 2/2] selftests/futex: fix the failed futex_requeue test issue
@ 2026-02-05  2:05 Yuwen Chen
  0 siblings, 0 replies; 7+ messages in thread
From: Yuwen Chen @ 2026-02-05  2:05 UTC (permalink / raw)
  To: tglx
  Cc: ywen.chen, akpm, andrealmeid, bigeasy, colin.i.king, dave, dvhart,
	edliaw, justinstitt, kernel-team, licayy, linux-kernel,
	linux-kselftest, luto, mingo, morbo, nathan, ndesaulniers, peterz,
	shuah, usama.anjum, wakel

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.

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

Fixes: 7cb5dd8e2c8c ("selftests: futex: Add futex compare requeue test")
Signed-off-by: Yuwen Chen <ywen.chen@foxmail.com>
Co-developed-by: Edward Liaw <edliaw@google.com>
Signed-off-by: Edward Liaw <edliaw@google.com>
---
 .../futex/functional/futex_requeue.c          | 38 +++++++++++--------
 1 file changed, 22 insertions(+), 16 deletions(-)

diff --git a/tools/testing/selftests/futex/functional/futex_requeue.c b/tools/testing/selftests/futex/functional/futex_requeue.c
index dcf0d5f2f3122..ab87bfc4edae0 100644
--- a/tools/testing/selftests/futex/functional/futex_requeue.c
+++ b/tools/testing/selftests/futex/functional/futex_requeue.c
@@ -9,51 +9,53 @@
 #include <limits.h>
 
 #include "futextest.h"
+#include "futex_thread.h"
 #include "kselftest_harness.h"
 
-#define timeout_ns  30000000
-#define WAKE_WAIT_US 10000
+#define FUTEX_WAIT_TIMEOUT_SECS 3
 
 volatile futex_t *f1;
 
-void *waiterfn(void *arg)
+static int waiterfn(void *arg)
 {
 	struct timespec to;
 
-	to.tv_sec = 0;
-	to.tv_nsec = timeout_ns;
+	to.tv_sec = FUTEX_WAIT_TIMEOUT_SECS;
+	to.tv_nsec = 0;
 
-	if (futex_wait(f1, *f1, &to, 0))
+	if (futex_wait(f1, *f1, &to, 0)) {
 		printf("waiter failed errno %d\n", errno);
+		return -errno;
+	}
 
-	return NULL;
+	return 0;
 }
 
 TEST(requeue_single)
 {
+	struct futex_thread waiter;
 	volatile futex_t _f1 = 0;
 	volatile futex_t f2 = 0;
-	pthread_t waiter[10];
 
 	f1 = &_f1;
 
 	/*
 	 * Requeue a waiter from f1 to f2, and wake f2.
 	 */
-	ASSERT_EQ(0, pthread_create(&waiter[0], NULL, waiterfn, NULL));
-
-	usleep(WAKE_WAIT_US);
+	ASSERT_EQ(0, futex_thread_create(&waiter, waiterfn, NULL));
+	futex_wait_for_thread(&waiter);
 
 	EXPECT_EQ(1, futex_cmp_requeue(f1, 0, &f2, 0, 1, 0));
 	EXPECT_EQ(1, futex_wake(&f2, 1, 0));
+
+	EXPECT_EQ(0, futex_thread_destroy(&waiter));
 }
 
 TEST(requeue_multiple)
 {
+	struct futex_thread waiter[10];
 	volatile futex_t _f1 = 0;
 	volatile futex_t f2 = 0;
-	pthread_t waiter[10];
-	int i;
 
 	f1 = &_f1;
 
@@ -61,13 +63,17 @@ TEST(requeue_multiple)
 	 * Create 10 waiters at f1. At futex_requeue, wake 3 and requeue 7.
 	 * At futex_wake, wake INT_MAX (should be exactly 7).
 	 */
-	for (i = 0; i < 10; i++)
-		ASSERT_EQ(0, pthread_create(&waiter[i], NULL, waiterfn, NULL));
+	for (int i = 0; i < 10; i++)
+		ASSERT_EQ(0, futex_thread_create(&waiter[i], waiterfn, NULL));
 
-	usleep(WAKE_WAIT_US);
+	for (int i = 0; i < 10; i++)
+		futex_wait_for_thread(&waiter[i]);
 
 	EXPECT_EQ(10, futex_cmp_requeue(f1, 0, &f2, 3, 7, 0));
 	EXPECT_EQ(7, futex_wake(&f2, INT_MAX, 0));
+
+	for (int i = 0; i < 10; i++)
+		EXPECT_EQ(0, futex_thread_destroy(&waiter[i]));
 }
 
 TEST_HARNESS_MAIN
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v5 1/2] selftests/futex: implement the interfaces related to threads
  2026-02-05  2:00 [PATCH v5 0/2] selftests/futex: fix the failed futex_requeue test Yuwen Chen
@ 2026-02-05  2:08 ` Yuwen Chen
  2026-02-13  8:23   ` Thomas Gleixner
  2026-02-05  2:09 ` [PATCH v5 2/2] selftests/futex: fix the failed futex_requeue test issue Yuwen Chen
  1 sibling, 1 reply; 7+ messages in thread
From: Yuwen Chen @ 2026-02-05  2:08 UTC (permalink / raw)
  To: ywen.chen
  Cc: akpm, andrealmeid, bigeasy, colin.i.king, dave, dvhart, edliaw,
	justinstitt, kernel-team, licayy, linux-kernel, linux-kselftest,
	luto, mingo, morbo, nathan, ndesaulniers, peterz, shuah, tglx,
	usama.anjum, wakel

There are timing issues in the use of threads in some unit test cases
for futex. A potentially good solution is to check whether the thread
is in the sleep state after creating it.

This patch adds a file named futex_thread.h, in which several thread
related functions are implemented to facilitate the solution of this
problem.

Signed-off-by: Yuwen Chen <ywen.chen@foxmail.com>
---
 .../selftests/futex/include/futex_thread.h    | 106 ++++++++++++++++++
 1 file changed, 106 insertions(+)
 create mode 100644 tools/testing/selftests/futex/include/futex_thread.h

diff --git a/tools/testing/selftests/futex/include/futex_thread.h b/tools/testing/selftests/futex/include/futex_thread.h
new file mode 100644
index 0000000000000..4f31299fe32c1
--- /dev/null
+++ b/tools/testing/selftests/futex/include/futex_thread.h
@@ -0,0 +1,106 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#ifndef _FUTEX_THREAD_H
+#define _FUTEX_THREAD_H
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#define USEC_PER_SEC 1000000L
+#define WAIT_THREAD_RETRIES 100
+#define WAIT_THREAD_CREATE_TIMEOUT_USECS (USEC_PER_SEC)
+
+struct futex_thread {
+	pthread_t		thread;
+	pthread_barrier_t	barrier;
+	pid_t			tid;
+	int			(*threadfn)(void *arg);
+	void			*arg;
+	int			retval;
+};
+
+static int __wait_for_thread(FILE *fp)
+{
+	char buf[80] = "";
+
+	for (int i = 0; i < WAIT_THREAD_RETRIES; i++) {
+		if (!fgets(buf, sizeof(buf), fp))
+			return -EIO;
+		if (!strncmp(buf, "futex", 5))
+			return 0;
+		usleep(WAIT_THREAD_CREATE_TIMEOUT_USECS / WAIT_THREAD_RETRIES);
+		rewind(fp);
+	}
+	return -ETIMEDOUT;
+}
+
+static void *__futex_thread_fn(void *arg)
+{
+	struct futex_thread *t = arg;
+
+	t->tid = gettid();
+	pthread_barrier_wait(&t->barrier);
+	t->retval = t->threadfn(t->arg);
+	return NULL;
+}
+
+/**
+ * futex_wait_for_thread - Wait for the child thread to sleep in the futex context
+ * @t: Thread handle.
+ */
+static int futex_wait_for_thread(struct futex_thread *t)
+{
+	char fname[80];
+	FILE *fp;
+	int res;
+
+	snprintf(fname, sizeof(fname), "/proc/%d/wchan", t->tid);
+	fp = fopen(fname, "r");
+	if (!fp) {
+		usleep(USEC_PER_SEC / 10);
+		return -EIO;
+	}
+
+	res = __wait_for_thread(fp);
+	if (res == -EIO)
+		usleep(USEC_PER_SEC / 10);
+
+	fclose(fp);
+	return res;
+}
+
+/**
+ * futex_thread_create - Create a new thread for testing.
+ * @t:        The handle of the newly created thread.
+ * @threadfn: The new thread starts execution by invoking threadfn
+ * @arg:      The parameters passed to threadfn.
+ */
+static int futex_thread_create(struct futex_thread *t, int (*threadfn)(void *), void *arg)
+{
+	int ret;
+
+	pthread_barrier_init(&t->barrier, NULL, 2);
+	t->tid = 0;
+	t->threadfn = threadfn;
+	t->arg = arg;
+
+	ret = pthread_create(&t->thread, NULL, __futex_thread_fn, t);
+	if (ret)
+		return ret;
+
+	pthread_barrier_wait(&t->barrier);
+	return 0;
+}
+
+/**
+ * futex_thread_destroy - Wait for and reclaim the resources of the thread.
+ * @t:      Thread handle.
+ */
+static int futex_thread_destroy(struct futex_thread *t)
+{
+	pthread_join(t->thread, NULL);
+	pthread_barrier_destroy(&t->barrier);
+	return t->retval;
+}
+
+#endif
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v5 2/2] selftests/futex: fix the failed futex_requeue test issue
  2026-02-05  2:00 [PATCH v5 0/2] selftests/futex: fix the failed futex_requeue test Yuwen Chen
  2026-02-05  2:08 ` [PATCH v5 1/2] selftests/futex: implement the interfaces related to threads Yuwen Chen
@ 2026-02-05  2:09 ` Yuwen Chen
  2026-02-13  8:25   ` Thomas Gleixner
  1 sibling, 1 reply; 7+ messages in thread
From: Yuwen Chen @ 2026-02-05  2:09 UTC (permalink / raw)
  To: ywen.chen
  Cc: akpm, andrealmeid, bigeasy, colin.i.king, dave, dvhart, edliaw,
	justinstitt, kernel-team, licayy, linux-kernel, linux-kselftest,
	luto, mingo, morbo, nathan, ndesaulniers, peterz, shuah, tglx,
	usama.anjum, wakel

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.

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

Fixes: 7cb5dd8e2c8c ("selftests: futex: Add futex compare requeue test")
Signed-off-by: Yuwen Chen <ywen.chen@foxmail.com>
Co-developed-by: Edward Liaw <edliaw@google.com>
Signed-off-by: Edward Liaw <edliaw@google.com>
---
 .../futex/functional/futex_requeue.c          | 38 +++++++++++--------
 1 file changed, 22 insertions(+), 16 deletions(-)

diff --git a/tools/testing/selftests/futex/functional/futex_requeue.c b/tools/testing/selftests/futex/functional/futex_requeue.c
index dcf0d5f2f3122..ab87bfc4edae0 100644
--- a/tools/testing/selftests/futex/functional/futex_requeue.c
+++ b/tools/testing/selftests/futex/functional/futex_requeue.c
@@ -9,51 +9,53 @@
 #include <limits.h>
 
 #include "futextest.h"
+#include "futex_thread.h"
 #include "kselftest_harness.h"
 
-#define timeout_ns  30000000
-#define WAKE_WAIT_US 10000
+#define FUTEX_WAIT_TIMEOUT_SECS 3
 
 volatile futex_t *f1;
 
-void *waiterfn(void *arg)
+static int waiterfn(void *arg)
 {
 	struct timespec to;
 
-	to.tv_sec = 0;
-	to.tv_nsec = timeout_ns;
+	to.tv_sec = FUTEX_WAIT_TIMEOUT_SECS;
+	to.tv_nsec = 0;
 
-	if (futex_wait(f1, *f1, &to, 0))
+	if (futex_wait(f1, *f1, &to, 0)) {
 		printf("waiter failed errno %d\n", errno);
+		return -errno;
+	}
 
-	return NULL;
+	return 0;
 }
 
 TEST(requeue_single)
 {
+	struct futex_thread waiter;
 	volatile futex_t _f1 = 0;
 	volatile futex_t f2 = 0;
-	pthread_t waiter[10];
 
 	f1 = &_f1;
 
 	/*
 	 * Requeue a waiter from f1 to f2, and wake f2.
 	 */
-	ASSERT_EQ(0, pthread_create(&waiter[0], NULL, waiterfn, NULL));
-
-	usleep(WAKE_WAIT_US);
+	ASSERT_EQ(0, futex_thread_create(&waiter, waiterfn, NULL));
+	futex_wait_for_thread(&waiter);
 
 	EXPECT_EQ(1, futex_cmp_requeue(f1, 0, &f2, 0, 1, 0));
 	EXPECT_EQ(1, futex_wake(&f2, 1, 0));
+
+	EXPECT_EQ(0, futex_thread_destroy(&waiter));
 }
 
 TEST(requeue_multiple)
 {
+	struct futex_thread waiter[10];
 	volatile futex_t _f1 = 0;
 	volatile futex_t f2 = 0;
-	pthread_t waiter[10];
-	int i;
 
 	f1 = &_f1;
 
@@ -61,13 +63,17 @@ TEST(requeue_multiple)
 	 * Create 10 waiters at f1. At futex_requeue, wake 3 and requeue 7.
 	 * At futex_wake, wake INT_MAX (should be exactly 7).
 	 */
-	for (i = 0; i < 10; i++)
-		ASSERT_EQ(0, pthread_create(&waiter[i], NULL, waiterfn, NULL));
+	for (int i = 0; i < 10; i++)
+		ASSERT_EQ(0, futex_thread_create(&waiter[i], waiterfn, NULL));
 
-	usleep(WAKE_WAIT_US);
+	for (int i = 0; i < 10; i++)
+		futex_wait_for_thread(&waiter[i]);
 
 	EXPECT_EQ(10, futex_cmp_requeue(f1, 0, &f2, 3, 7, 0));
 	EXPECT_EQ(7, futex_wake(&f2, INT_MAX, 0));
+
+	for (int i = 0; i < 10; i++)
+		EXPECT_EQ(0, futex_thread_destroy(&waiter[i]));
 }
 
 TEST_HARNESS_MAIN
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v5 1/2] selftests/futex: implement the interfaces related to threads
  2026-02-05  2:08 ` [PATCH v5 1/2] selftests/futex: implement the interfaces related to threads Yuwen Chen
@ 2026-02-13  8:23   ` Thomas Gleixner
  2026-02-27  8:53     ` Yuwen Chen
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Gleixner @ 2026-02-13  8:23 UTC (permalink / raw)
  To: Yuwen Chen, ywen.chen
  Cc: akpm, andrealmeid, bigeasy, colin.i.king, dave, dvhart, edliaw,
	justinstitt, kernel-team, licayy, linux-kernel, linux-kselftest,
	luto, mingo, morbo, nathan, ndesaulniers, peterz, shuah,
	usama.anjum, wakel

On Thu, Feb 05 2026 at 10:08, Yuwen Chen wrote:
> There are timing issues in the use of threads in some unit test cases
> for futex.

This is handwaving and contains zero technical information.

https://www.kernel.org/doc/html/latest/process/maintainer-tip.html#changelog

> A potentially good solution is to check whether the thread

Either it's a solution or not. 

> is in the sleep state after creating it.

> This patch adds a file named futex_thread.h, in which several thread

# git grep 'This patch' Documentation/process/

> related functions are implemented to facilitate the solution of this
> problem.
>
> Signed-off-by: Yuwen Chen <ywen.chen@foxmail.com>

https://www.kernel.org/doc/html/latest/process/submitting-patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes

> +#ifndef _FUTEX_THREAD_H
> +#define _FUTEX_THREAD_H
> +#include <stdio.h>
> +#include <string.h>
> +#include <errno.h>
> +
> +#define USEC_PER_SEC 1000000L

#include <linux/time64.h>

> +#define WAIT_THREAD_RETRIES 100
> +#define WAIT_THREAD_CREATE_TIMEOUT_USECS (USEC_PER_SEC)
> +
> +struct futex_thread {
> +	pthread_t		thread;
> +	pthread_barrier_t	barrier;
> +	pid_t			tid;
> +	int			(*threadfn)(void *arg);
> +	void			*arg;
> +	int			retval;
> +};
> +
> +static int __wait_for_thread(FILE *fp)
> +{
> +	char buf[80] = "";
> +
> +	for (int i = 0; i < WAIT_THREAD_RETRIES; i++) {
> +		if (!fgets(buf, sizeof(buf), fp))
> +			return -EIO;
> +		if (!strncmp(buf, "futex", 5))
> +			return 0;
> +		usleep(WAIT_THREAD_CREATE_TIMEOUT_USECS / WAIT_THREAD_RETRIES);

What's wrong with

#define WAIT_THREAD_DELAY	(USEC_PER_SEC / WAIT_THREAD_RETRIES)
...
                usleep(WAIT_THREAD_DELAY);

> +		rewind(fp);
> +	}
> +	return -ETIMEDOUT;
> +}
> +
> +static void *__futex_thread_fn(void *arg)
> +{
> +	struct futex_thread *t = arg;
> +
> +	t->tid = gettid();
> +	pthread_barrier_wait(&t->barrier);
> +	t->retval = t->threadfn(t->arg);
> +	return NULL;
> +}
> +
> +/**
> + * futex_wait_for_thread - Wait for the child thread to sleep in the futex context
> + * @t: Thread handle.
> + */
> +static int futex_wait_for_thread(struct futex_thread *t)
> +{
> +	char fname[80];
> +	FILE *fp;
> +	int res;
> +
> +	snprintf(fname, sizeof(fname), "/proc/%d/wchan", t->tid);
> +	fp = fopen(fname, "r");
> +	if (!fp) {
> +		usleep(USEC_PER_SEC / 10);

What is this usleep for?

> +		return -EIO;
> +	}
> +
> +	res = __wait_for_thread(fp);
> +	if (res == -EIO)
> +		usleep(USEC_PER_SEC / 10);

Again. What's this usleep for?

If the file cannot be opened or fgets() fails then this fails hard.

> +	fclose(fp);
> +	return res;
> +}
> +
> +/**
> + * futex_thread_create - Create a new thread for testing.
> + * @t:        The handle of the newly created thread.
> + * @threadfn: The new thread starts execution by invoking threadfn
> + * @arg:      The parameters passed to threadfn.
> + */
> +static int futex_thread_create(struct futex_thread *t, int (*threadfn)(void *), void *arg)
> +{
> +	int ret;
> +
> +	pthread_barrier_init(&t->barrier, NULL, 2);
> +	t->tid = 0;
> +	t->threadfn = threadfn;
> +	t->arg = arg;
> +
> +	ret = pthread_create(&t->thread, NULL, __futex_thread_fn, t);
> +	if (ret)
> +		return ret;
> +
> +	pthread_barrier_wait(&t->barrier);
> +	return 0;

Why aren't you waiting for the thread right here? There is absolutely no
point in doing that at the call site of futex_thread_create().

Thanks,

        tglx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v5 2/2] selftests/futex: fix the failed futex_requeue test issue
  2026-02-05  2:09 ` [PATCH v5 2/2] selftests/futex: fix the failed futex_requeue test issue Yuwen Chen
@ 2026-02-13  8:25   ` Thomas Gleixner
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Gleixner @ 2026-02-13  8:25 UTC (permalink / raw)
  To: Yuwen Chen, ywen.chen
  Cc: akpm, andrealmeid, bigeasy, colin.i.king, dave, dvhart,
	justinstitt, kernel-team, licayy, linux-kernel, linux-kselftest,
	luto, mingo, morbo, nathan, peterz, shuah, usama.anjum, wakel

On Thu, Feb 05 2026 at 10:09, Yuwen Chen wrote:
>  TEST(requeue_single)
>  {
> +	struct futex_thread waiter;
>  	volatile futex_t _f1 = 0;
>  	volatile futex_t f2 = 0;
> -	pthread_t waiter[10];
>  
>  	f1 = &_f1;
>  
>  	/*
>  	 * Requeue a waiter from f1 to f2, and wake f2.
>  	 */
> -	ASSERT_EQ(0, pthread_create(&waiter[0], NULL, waiterfn, NULL));
> -
> -	usleep(WAKE_WAIT_US);
> +	ASSERT_EQ(0, futex_thread_create(&waiter, waiterfn, NULL));
> +	futex_wait_for_thread(&waiter);

This is a horrible hack. If that wait fails, there is no point to
continue.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v5 1/2] selftests/futex: implement the interfaces related to threads
  2026-02-13  8:23   ` Thomas Gleixner
@ 2026-02-27  8:53     ` Yuwen Chen
  0 siblings, 0 replies; 7+ messages in thread
From: Yuwen Chen @ 2026-02-27  8:53 UTC (permalink / raw)
  To: tglx
  Cc: akpm, andrealmeid, bigeasy, colin.i.king, dave, dvhart, edliaw,
	justinstitt, kernel-team, licayy, linux-kernel, linux-kselftest,
	luto, mingo, morbo, nathan, ndesaulniers, peterz, shuah,
	usama.anjum, wakel, ywen.chen

On Fri, 13 Feb 2026 09:23:14 +0100, Thomas Gleixner wrote:

> Again. What's this usleep for?
> 
> If the file cannot be opened or fgets() fails then this fails hard.

On embedded platforms, the CONFIG_KALLSYMS compilation option may not
be enabled due to reasons such as reducing the size. This will cause
the test item to fail. Do you still insist on returning a test failure
when the opening fails?

> Why aren't you waiting for the thread right here? There is absolutely no
> point in doing that at the call site of futex_thread_create().

Also for the reasons mentioned above, my idea is to ensure that the test
item can pass with a high probability even if the CONFIG_KALLSYMS option
is not enabled.

Thank you very much for your patient guidance. I was quite busy some
time ago, so I'm replying to you now. I'm really sorry.

Thanks


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-02-27  8:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-05  2:00 [PATCH v5 0/2] selftests/futex: fix the failed futex_requeue test Yuwen Chen
2026-02-05  2:08 ` [PATCH v5 1/2] selftests/futex: implement the interfaces related to threads Yuwen Chen
2026-02-13  8:23   ` Thomas Gleixner
2026-02-27  8:53     ` Yuwen Chen
2026-02-05  2:09 ` [PATCH v5 2/2] selftests/futex: fix the failed futex_requeue test issue Yuwen Chen
2026-02-13  8:25   ` Thomas Gleixner
  -- strict thread matches above, loose matches on Subject: below --
2026-02-05  2:05 Yuwen Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox