From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB0CA3A7580; Sun, 5 Jul 2026 19:54:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783281279; cv=none; b=iPj77dkKrTd8Tftu8xo/S4HEJPcHwji7adDkkTkCKfQubs98ykbt3IasocOpcOKmDbAXMbzhP+VOVmWejToL+07ViZTeVFOs8p7MBQURw8zJLTjEyGFsDscCvRZNHA6hYie/Z06iy7EGaDp+CPOoeunx49RN+JcMmhX3htayhMY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783281279; c=relaxed/simple; bh=8DAukCbEeVGKAmY6oEmoh8dLsmbeynNuePgy4IcoWCY=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=jyqG8yXyj19l/1bqG8IA+MHACMFG9+umWSDwdrI29xLzhJ1FiEV23gRERNisxojIj5zJ27uw/RAFOEEIVFxq8R9rsaFXRThhlYrsGg/vpZQ5tmOoqOxqw7MJrQOFz6iJ11iiaxWeoMsqbUj2CNCmfpomTX3k56lchoID/ddpWME= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=PkBVpnpu; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=39Ce5826; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="PkBVpnpu"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="39Ce5826" Date: Sun, 05 Jul 2026 19:54:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1783281273; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CxtQj2sjCcUrQ31poYVgZOIGs6xi51D5jf/+KCkMc88=; b=PkBVpnpuYu9Dg8HUw7nMWuN3HX51lmgI+IkltbAHvpis9pY97ldqsasSrwML/zNq16H0bY xxcrXcM0X4nw69G1NJiZkRgzOYUShqx1BOsglTCppJZpTrXkjiLeKxSY0Blk5VdVTjnTYB QXF+Vo9DNFKjXccp7OdIrwq9eGZbXd+y+D27ne4nse2GtWPLJot4Oi5zGzaHPz+uR5x7aO X9dXC+l9r6dw34RqbSbW4HNDFRQsm/mHz1MByDyYBJ6pyxfosWwvoKBE+t29DO1HNpBDtS +8UE1w98GDgPzc+mv0kTaNJAhMoiALABd4F3kwSjbH6fGSKmjI6SEob6d/qT8g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1783281273; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CxtQj2sjCcUrQ31poYVgZOIGs6xi51D5jf/+KCkMc88=; b=39Ce5826QyP0clg+f/XeBKHRJsZJc9KxM6wFKRgTdlW3vgN2+DBTyMUc76/VzrP5mOTVfR 8H5df42rfXy9YnDw== From: "tip-bot2 for Wake Liu" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/futex] selftests/futex: Migrate futex_requeue_pi_mismatched_ops to harness Cc: Wake Liu , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260601065126.3623867-4-wakel@google.com> References: <20260601065126.3623867-4-wakel@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178328127205.744054.539585229935511014.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the locking/futex branch of tip: Commit-ID: 4559deb7382861b5e920bbccdf62c470384ab0ac Gitweb: https://git.kernel.org/tip/4559deb7382861b5e920bbccdf62c470384= ab0ac Author: Wake Liu AuthorDate: Mon, 01 Jun 2026 06:51:22=20 Committer: Thomas Gleixner 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 Signed-off-by: Thomas Gleixner 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_mismat= ched_ops.c b/tools/testing/selftests/futex/functional/futex_requeue_pi_mismat= ched_ops.c index f686e60..35bb8a8 100644 --- a/tools/testing/selftests/futex/functional/futex_requeue_pi_mismatched_op= s.c +++ b/tools/testing/selftests/futex/functional/futex_requeue_pi_mismatched_op= s.c @@ -29,14 +29,17 @@ =20 futex_t f1 =3D FUTEX_INITIALIZER; futex_t f2 =3D FUTEX_INITIALIZER; -int child_ret =3D 0; +int child_ret; =20 void *blocking_child(void *arg) { + struct __test_metadata *_metadata =3D (struct __test_metadata *)arg; + child_ret =3D futex_wait(&f1, f1, NULL, FUTEX_PRIVATE_FLAG); if (child_ret < 0) { child_ret =3D -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; =20 - 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"); =20 /* Allow the child to block in the kernel. */ sleep(1); @@ -67,27 +70,33 @@ TEST(requeue_pi_mismatched_ops) * FUTEX_WAKE. */ ret =3D futex_wake(&f1, 1, FUTEX_PRIVATE_FLAG); - if (ret =3D=3D 1) + if (ret =3D=3D 1) { ret =3D 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"); } =20 pthread_join(child, NULL); =20 - 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=3D%d", ret); + EXPECT_EQ(child_ret, 0) + TH_LOG("Child failed: child_ret=3D%d", child_ret); } =20 TEST_HARNESS_MAIN