mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yuwen Chen <ywen.chen@foxmail.com>
To: tglx@kernel.org
Cc: akpm@linux-foundation.org, andrealmeid@igalia.com,
	bigeasy@linutronix.de, broonie@kernel.org,
	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, mark.rutland@arm.com, mingo@redhat.com,
	morbo@google.com, nathan@kernel.org, ndesaulniers@google.com,
	peterz@infradead.org, shuah@kernel.org,
	usama.anjum@collabora.com, wakel@google.com,
	ywen.chen@foxmail.com
Subject: Re: [PATCH v8 2/2] selftests/futex: fix the failed futex_requeue test issue
Date: Wed,  8 Jul 2026 09:54:29 +0800	[thread overview]
Message-ID: <tencent_9C5F035DDB450CDC0CE3ACAE39E75E796908@qq.com> (raw)
In-Reply-To: <87cxwys7fi.ffs@fw13>

On Wed, 08 Jul 2026 01:31:45 +0200, Thomas Gleixner wrote:

> Do you have /proc/ disabled by chance or is it not accessible for the
> test case?
...
> Seems to correlate with the test case failure: Connection timed out :)

I used the following patch to simulate the situation where the proc file
system is not mounted on the system. The log is very similar to that of
the current problem.

--- a/tools/testing/selftests/futex/include/futex_thread.h
+++ b/tools/testing/selftests/futex/include/futex_thread.h
@@ -62,7 +62,8 @@ static inline int futex_wait_for_thread(struct futex_thread *t, struct __test_me
        int res;
 
        snprintf(fname, sizeof(fname), "/proc/%d/wchan", t->tid);
-       fp = fopen(fname, "r");
+       errno = ENOENT;
+       fp = NULL;
        if (!fp) {
                /* If /proc/... is not available, sleep */
                if (errno != ENOENT)

The corresponding logs are as follows:

  TAP version 13
  1..2
  # Starting 2 tests from 1 test cases.
  #  RUN           global.requeue_single ...
  # ../include/futex_thread.h:71:requeue_single:/proc/$PID/wchan not accessible, continue with sleep()
  # futex_requeue.c:28:requeue_single:Expected res (-1) == 0 (0)
  # futex_requeue.c:52:requeue_single:Expected futex_cmp_requeue(f1, 0, &f2, 0, 1, 0) (0) == 1 (1)
  # futex_requeue.c:53:requeue_single:Expected futex_wake(&f2, 1, 0) (0) == 1 (1)
  # futex_requeue.c:29:requeue_single:waiter failed errno 110: Connection timed out
  # requeue_single: Test failed
  #          FAIL  global.requeue_single
  not ok 1 global.requeue_single
  #  RUN           global.requeue_multiple ...
  # ../include/futex_thread.h:71:requeue_multiple:/proc/$PID/wchan not accessible, continue with sleep()
  # futex_requeue.c:28:requeue_multiple:Expected res (-1) == 0 (0)
  # futex_requeue.c:28:requeue_multiple:Expected res (-1) == 0 (0)
  # futex_requeue.c:29:requeue_multiple:waiter failed errno 110: Connection timed out
  # futex_requeue.c:29:requeue_multiple:waiter failed errno 110: Connection timed out
  # futex_requeue.c:28:requeue_multiple:Expected res (-1) == 0 (0)
  # futex_requeue.c:29:requeue_multiple:waiter failed errno 110: Connection timed out
  # futex_requeue.c:28:requeue_multiple:Expected res (-1) == 0 (0)
  # futex_requeue.c:29:requeue_multiple:waiter failed errno 110: Connection timed out
  # futex_requeue.c:28:requeue_multiple:Expected res (-1) == 0 (0)
  # futex_requeue.c:29:requeue_multiple:waiter failed errno 110: Connection timed out
  # futex_requeue.c:28:requeue_multiple:Expected res (-1) == 0 (0)
  # futex_requeue.c:29:requeue_multiple:waiter failed errno 110: Connection timed out
  # futex_requeue.c:28:requeue_multiple:Expected res (-1) == 0 (0)
  # futex_requeue.c:29:requeue_multiple:waiter failed errno 110: Connection timed out
  # futex_requeue.c:28:requeue_multiple:Expected res (-1) == 0 (0)
  # futex_requeue.c:29:requeue_multiple:waiter failed errno 110: Connection timed out
  # futex_requeue.c:28:requeue_multiple:Expected res (-1) == 0 (0)
  # futex_requeue.c:29:requeue_multiple:waiter failed errno 110: Connection timed out
  # futex_requeue.c:28:requeue_multiple:Expected res (-1) == 0 (0)
  # futex_requeue.c:29:requeue_multiple:waiter failed errno 110: Connection timed out
  # ../include/futex_thread.h:71:requeue_multiple:/proc/$PID/wchan not accessible, continue with sleep()
  # ../include/futex_thread.h:71:requeue_multiple:/proc/$PID/wchan not accessible, continue with sleep()
  # ../include/futex_thread.h:71:requeue_multiple:/proc/$PID/wchan not accessible, continue with sleep()
  # ../include/futex_thread.h:71:requeue_multiple:/proc/$PID/wchan not accessible, continue with sleep()
  # ../include/futex_thread.h:71:requeue_multiple:/proc/$PID/wchan not accessible, continue with sleep()
  # ../include/futex_thread.h:71:requeue_multiple:/proc/$PID/wchan not accessible, continue with sleep()
  # ../include/futex_thread.h:71:requeue_multiple:/proc/$PID/wchan not accessible, continue with sleep()
  # ../include/futex_thread.h:71:requeue_multiple:/proc/$PID/wchan not accessible, continue with sleep()
  # ../include/futex_thread.h:71:requeue_multiple:/proc/$PID/wchan not accessible, continue with sleep()
  # futex_requeue.c:80:requeue_multiple:Expected futex_cmp_requeue(f1, 0, &f2, 3, 7, 0) (0) == 10 (10)
  # futex_requeue.c:81:requeue_multiple:Expected futex_wake(&f2, INT_MAX, 0) (0) == 7 (7)
  # requeue_multiple: Test failed
  #          FAIL  global.requeue_multiple
  not ok 2 global.requeue_multiple
  # FAILED: 0 / 2 tests passed.
  # Totals: pass:0 fail:2 xfail:0 xpass:0 skip:0 error:0

I suggested adding a parameter for the waiting time to the futex_wait_for_thread function.
In this way, when the proc file system is not mounted on the system, the old solution
can still be used.

Thanks.


  parent reply	other threads:[~2026-07-08  1:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-18  2:15 [PATCH v8 0/2] " Yuwen Chen
2026-05-18  2:16 ` [PATCH v8 1/2] selftests/futex: implement the interfaces related to threads Yuwen Chen
2026-07-05 19:54   ` [tip: locking/futex] selftests/futex: Provide thread creation and synchronization helpers tip-bot2 for Yuwen Chen
2026-05-18  2:16 ` [PATCH v8 2/2] selftests/futex: fix the failed futex_requeue test issue Yuwen Chen
2026-05-19  2:06   ` Yuwen Chen
2026-07-05 19:54   ` [tip: locking/futex] selftests/futex: Use thread synchronization helpers instead of usleep() tip-bot2 for Yuwen Chen
2026-07-07 22:28   ` [PATCH v8 2/2] selftests/futex: fix the failed futex_requeue test issue Mark Brown
2026-07-07 23:31     ` Thomas Gleixner
2026-07-07 23:48       ` Mark Brown
2026-07-08  1:54       ` Yuwen Chen [this message]
2026-07-08  8:08         ` Thomas Gleixner
2026-07-14 17:41       ` Mark Brown

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_9C5F035DDB450CDC0CE3ACAE39E75E796908@qq.com \
    --to=ywen.chen@foxmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrealmeid@igalia.com \
    --cc=bigeasy@linutronix.de \
    --cc=broonie@kernel.org \
    --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=mark.rutland@arm.com \
    --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

Powered by JetHome