mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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: Dynamically skip unsupported tests
Date: Sun, 05 Jul 2026 19:54:23 -0000	[thread overview]
Message-ID: <178328126341.744054.16792154276399354951.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260624070223.1533167-1-wakel@google.com>

The following commit has been merged into the locking/futex branch of tip:

Commit-ID:     50c121e5a57abe446e46825fb9c69ac419765d5c
Gitweb:        https://git.kernel.org/tip/50c121e5a57abe446e46825fb9c69ac419765d5c
Author:        Wake Liu <wakel@google.com>
AuthorDate:    Wed, 24 Jun 2026 07:02:23 
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Sun, 05 Jul 2026 21:49:18 +02:00

selftests/futex: Dynamically skip unsupported tests

Some new futex tests rely on kernel features that may not be supported
on all configurations (e.g., FUTEX2_NUMA or PR_FUTEX_HASH).
Currently, these tests fail with EINVAL when the features are missing.

Add dynamic skip logic to:

 - futex_priv_hash: Skip if PR_FUTEX_HASH returns ENOSYS or EINVAL.

 - futex_numa_mpol: Skip if futex2 or FUTEX2_NUMA returns ENOSYS or EINVAL.

This allows the tests to pass (as SKIPPED) on kernels without support,
while preserving coverage on configurations that do support them.

[ tglx: Adapt to harness changes, massage change log ]

Signed-off-by: Wake Liu <wakel@google.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260624070223.1533167-1-wakel@google.com
---
 tools/testing/selftests/futex/functional/futex_numa_mpol.c | 3 +++
 tools/testing/selftests/futex/functional/futex_priv_hash.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/tools/testing/selftests/futex/functional/futex_numa_mpol.c b/tools/testing/selftests/futex/functional/futex_numa_mpol.c
index c79184f..4ffcf41 100644
--- a/tools/testing/selftests/futex/functional/futex_numa_mpol.c
+++ b/tools/testing/selftests/futex/functional/futex_numa_mpol.c
@@ -107,6 +107,9 @@ static void __test_futex(struct __test_metadata *_metadata, void *futex_ptr, int
 			break;
 		}
 		if (ret < 0) {
+			if (errno == ENOSYS || (errno == EINVAL && (futex_flags & FUTEX2_NUMA)))
+				SKIP(return, "futex2 or FUTEX2_NUMA not supported by kernel");
+
 			ASSERT_GE(ret, 0) {
 				TH_LOG("Failed futex2_wake(%d, 0x%x): %s",
 				       to_wake, futex_flags, strerror(errno));
diff --git a/tools/testing/selftests/futex/functional/futex_priv_hash.c b/tools/testing/selftests/futex/functional/futex_priv_hash.c
index a742a79..a8742e2 100644
--- a/tools/testing/selftests/futex/functional/futex_priv_hash.c
+++ b/tools/testing/selftests/futex/functional/futex_priv_hash.c
@@ -143,6 +143,9 @@ TEST(priv_hash)
 
 	/* First thread, expect to be 0, not yet initialized */
 	ret = futex_hash_slots_get();
+	if (ret < 0 && errno == EINVAL)
+		SKIP(return, "PR_FUTEX_HASH not supported by kernel");
+
 	ASSERT_EQ(ret, 0)
 		TH_LOG("futex_hash_slots_get() failed: %d, %s", ret, strerror(errno));
 

      reply	other threads:[~2026-07-05 19:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-24  7:02 [PATCH] " Wake Liu
2026-07-05 19:54 ` tip-bot2 for Wake Liu [this message]

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=178328126341.744054.16792154276399354951.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®