From: "tip-bot2 for Wake Liu" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Wake Liu <wakel@google.com>, Thomas Gleixner <tglx@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: locking/futex] selftests/futex: Migrate futex_requeue_pi_mismatched_ops to harness
Date: Sun, 05 Jul 2026 19:54:32 -0000 [thread overview]
Message-ID: <178328127205.744054.539585229935511014.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260601065126.3623867-4-wakel@google.com>
The following commit has been merged into the locking/futex branch of tip:
Commit-ID: 4559deb7382861b5e920bbccdf62c470384ab0ac
Gitweb: https://git.kernel.org/tip/4559deb7382861b5e920bbccdf62c470384ab0ac
Author: Wake Liu <wakel@google.com>
AuthorDate: Mon, 01 Jun 2026 06:51:22
Committer: Thomas Gleixner <tglx@kernel.org>
CommitterDate: Sun, 05 Jul 2026 21:49:18 +02:00
selftests/futex: Migrate futex_requeue_pi_mismatched_ops to harness
Migrate futex_requeue_pi_mismatched_ops test to the kselftest harness
framework, removing mixed legacy ksft_* API usages and passing test
metadata to helper thread.
[ tglx: Fixup coding style ]
Signed-off-by: Wake Liu <wakel@google.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260601065126.3623867-4-wakel@google.com
---
tools/testing/selftests/futex/functional/futex_requeue_pi_mismatched_ops.c | 41 +++++++++++++++++++++++++----------------
1 file changed, 25 insertions(+), 16 deletions(-)
diff --git a/tools/testing/selftests/futex/functional/futex_requeue_pi_mismatched_ops.c b/tools/testing/selftests/futex/functional/futex_requeue_pi_mismatched_ops.c
index f686e60..35bb8a8 100644
--- a/tools/testing/selftests/futex/functional/futex_requeue_pi_mismatched_ops.c
+++ b/tools/testing/selftests/futex/functional/futex_requeue_pi_mismatched_ops.c
@@ -29,14 +29,17 @@
futex_t f1 = FUTEX_INITIALIZER;
futex_t f2 = FUTEX_INITIALIZER;
-int child_ret = 0;
+int child_ret;
void *blocking_child(void *arg)
{
+ struct __test_metadata *_metadata = (struct __test_metadata *)arg;
+
child_ret = futex_wait(&f1, f1, NULL, FUTEX_PRIVATE_FLAG);
if (child_ret < 0) {
child_ret = -errno;
- ksft_exit_fail_msg("futex_wait\n");
+ ASSERT_EQ(child_ret, 0)
+ TH_LOG("futex_wait failed: %s", strerror(errno));
}
return (void *)&child_ret;
}
@@ -46,8 +49,8 @@ TEST(requeue_pi_mismatched_ops)
pthread_t child;
int ret;
- if (pthread_create(&child, NULL, blocking_child, NULL))
- ksft_exit_fail_msg("pthread_create\n");
+ ASSERT_EQ(pthread_create(&child, NULL, blocking_child, _metadata), 0)
+ TH_LOG("pthread_create failed");
/* Allow the child to block in the kernel. */
sleep(1);
@@ -67,27 +70,33 @@ TEST(requeue_pi_mismatched_ops)
* FUTEX_WAKE.
*/
ret = futex_wake(&f1, 1, FUTEX_PRIVATE_FLAG);
- if (ret == 1)
+ if (ret == 1) {
ret = 0;
- else if (ret < 0)
- ksft_exit_fail_msg("futex_wake\n");
- else
- ksft_exit_fail_msg("futex_wake did not wake the child\n");
+ } else if (ret < 0) {
+ ASSERT_GE(ret, 0)
+ TH_LOG("futex_wake failed: %s", strerror(errno));
+ } else {
+ ASSERT_TRUE(0)
+ TH_LOG("futex_wake did not wake the child");
+ }
} else {
- ksft_exit_fail_msg("futex_cmp_requeue_pi\n");
+ ASSERT_TRUE(0)
+ TH_LOG("futex_cmp_requeue_pi failed with unexpected errno: %s", strerror(errno));
}
} else if (ret > 0) {
- ksft_test_result_fail("futex_cmp_requeue_pi failed to detect the mismatch\n");
+ EXPECT_EQ(ret, 0)
+ TH_LOG("futex_cmp_requeue_pi failed to detect the mismatch");
} else {
- ksft_exit_fail_msg("futex_cmp_requeue_pi found no waiters\n");
+ ASSERT_TRUE(0)
+ TH_LOG("futex_cmp_requeue_pi found no waiters");
}
pthread_join(child, NULL);
- if (!ret && !child_ret)
- ksft_test_result_pass("futex_requeue_pi_mismatched_ops passed\n");
- else
- ksft_test_result_pass("futex_requeue_pi_mismatched_ops failed\n");
+ EXPECT_EQ(ret, 0)
+ TH_LOG("Test failed: ret=%d", ret);
+ EXPECT_EQ(child_ret, 0)
+ TH_LOG("Child failed: child_ret=%d", child_ret);
}
TEST_HARNESS_MAIN
next prev parent reply other threads:[~2026-07-05 19:54 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-01 6:51 [PATCH 0/7] selftests/futex: Migrate requeue, NUMA and robust list tests " Wake Liu
2026-06-01 6:51 ` [PATCH 1/7] selftests/futex: Migrate futex_requeue " Wake Liu
2026-07-05 19:54 ` [tip: locking/futex] " tip-bot2 for Wake Liu
2026-06-01 6:51 ` [PATCH 2/7] selftests/futex: Migrate futex_requeue_pi " Wake Liu
2026-07-05 19:54 ` [tip: locking/futex] " tip-bot2 for Wake Liu
2026-06-01 6:51 ` [PATCH 3/7] selftests/futex: Migrate futex_requeue_pi_mismatched_ops " Wake Liu
2026-07-05 19:54 ` tip-bot2 for Wake Liu [this message]
2026-06-01 6:51 ` [PATCH 4/7] selftests/futex: Migrate futex_requeue_pi_signal_restart " Wake Liu
2026-07-05 19:54 ` [tip: locking/futex] " tip-bot2 for Wake Liu
2026-06-01 6:51 ` [PATCH 5/7] selftests/futex: Migrate futex_numa_mpol " Wake Liu
2026-07-05 19:54 ` [tip: locking/futex] " tip-bot2 for Wake Liu
2026-06-01 6:51 ` [PATCH 6/7] selftests/futex: Migrate futex_priv_hash " Wake Liu
2026-07-05 19:54 ` [tip: locking/futex] " tip-bot2 for Wake Liu
2026-06-01 6:51 ` [PATCH 7/7] selftests/futex: Migrate robust_list " Wake Liu
2026-07-05 19:54 ` [tip: locking/futex] " tip-bot2 for Wake Liu
2026-06-01 8:24 ` [PATCH 0/7] selftests/futex: Migrate requeue, NUMA and robust list tests " Peter Zijlstra
2026-06-03 6:17 ` Wake Liu
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=178328127205.744054.539585229935511014.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=tglx@kernel.org \
--cc=wakel@google.com \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®