From patchwork Wed Oct 30 00:02:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13855782 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B153AD7494F for ; Wed, 30 Oct 2024 00:06:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/XsPYcD7+1wlXM+H9fIamHPiWKI2A5+aJMANpSEzI/Q=; b=W6Nrb+sB96tog8T64JfnC3JMdA q0BCqFhSAHmLGkFLvEWtMBprOfeAgZc1hBj7K/jZAPuOWJVUaEETlbV9WtcGkEbi1gJUR0sdsTKt9 OvfSi2gWV9GqEXiSsrxK/ZNld9pA3lFqjtRY13EHpT+vdkdADgDbhsDVKW/ymNN7VW5BoUrkYkoSY qv/Ih93s4y0a9SCdC+j6TTwDrPQB5DPPhhDiSLvjnNF8QkHGc+ZgXgN4PYph53yJbNihKFU2x0ZhK 8OAzZ0pP8Mf5XoNtcmqr/TWpV7b+Clv6tLsJPmMEHAztqPSvgPm80xHQ5I+CVZ70tsTy1daoHSTbe F/2dyAJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t5wDb-0000000GIKM-0RpB; Wed, 30 Oct 2024 00:05:47 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t5wAG-0000000GI5n-0NPT for linux-arm-kernel@lists.infradead.org; Wed, 30 Oct 2024 00:02:21 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 225C6A43617; Wed, 30 Oct 2024 00:00:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44B96C4CEE6; Wed, 30 Oct 2024 00:02:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730246538; bh=ZTF3X5004ugxu+b0r8whBammEg+NJnKe47itkV+Nzn0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=kQDOJqxmlCo+b8vm1je6stxuX61EXkKfESgokOQ/AGJ9HYuTrFJBdeBHATvhzK75A FfYZVlSwoKeKYuHryjM3HLdb2yVjUSjdExW0mnFNVytYociEp7NHM3flJFjW7nK+jO sdoQ5H1vAivIRZGR95Yn5yZ9LP1tsV3nbQHt01+2nw2Rd5vs6CYKbaTxHAC4xD3Z8m +81dnaNmDZwZPvpBq5jQh/feSLgqKsBhWLjwbSwqVHUyWrTkAakI639nhcCusko83c 1sQTk63gWMS1bFF6PCsFMVakMfvP3V7cFAZ1Tk8pN8UiA40DVHzBy60wU55UM6UoYL dHyJyfq0kJgiw== From: Mark Brown Date: Wed, 30 Oct 2024 00:02:02 +0000 Subject: [PATCH v2 1/2] kselftest/arm64: Increase frequency of signal delivery in fp-stress MIME-Version: 1.0 Message-Id: <20241030-arm64-fp-stress-interval-v2-1-bd3cef48c22c@kernel.org> References: <20241030-arm64-fp-stress-interval-v2-0-bd3cef48c22c@kernel.org> In-Reply-To: <20241030-arm64-fp-stress-interval-v2-0-bd3cef48c22c@kernel.org> To: Catalin Marinas , Will Deacon , Shuah Khan Cc: Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Brown X-Mailer: b4 0.15-dev-9b746 X-Developer-Signature: v=1; a=openpgp-sha256; l=3429; i=broonie@kernel.org; h=from:subject:message-id; bh=ZTF3X5004ugxu+b0r8whBammEg+NJnKe47itkV+Nzn0=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBnIXeFYSH8SGYUE/hJ8iQ2ZUyfWpkt2Dk/ZTv7+x1X OSLwqTiJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZyF3hQAKCRAk1otyXVSH0CUGB/ sHLIuDk/FjxdcsHp3mOCJNmYoruZN13js6UA45pOJSK0IElqkbQDzOTc3emdQmh4RwUAr8zTLkBYn3 dyXdEhVoRWrOEDSVS1aRh4ppE/LOv2rcCjq0ZhgFsn0B9YKFTTJTMQFBxizmt4hiZ/asHJUHof+Ko3 m+pVNLKYtvGMAgmWlekFYK4Mwv/D7JT81Blu4O3K/XL1IqktL+njQEpnZhuU3AI2usd02jDZQyX8ro zc9rrffUMIGyYl6jv2mMurXNR8J9mpzeu1jXYFdGqmiidlQldbpPMZ9yciDO7LDPdta0DppNUKydY+ K9ncEw/UKKAvXCdYGXvG4l5wKKB59u X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241029_170220_305365_A8E8261A X-CRM114-Status: GOOD ( 17.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently we only deliver signals to the processes being tested about once a second, meaning that the signal code paths are subject to relatively little stress. Increase this frequency substantially to 25ms intervals, along with some minor refactoring to make this more readily tuneable and maintain the 1s logging interval. This interval was chosen based on some experimentation with emulated platforms to avoid causing so much extra load that the test starts to run into the 45s limit for selftests or generally completely disconnect the timeout numbers from the We could increase this if we moved the signal generation out of the main supervisor thread, though we should also consider that he percentage of time that we spend interacting with the floating point state is also a consideration. Suggested-by: Mark Rutland Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/fp-stress.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/arm64/fp/fp-stress.c b/tools/testing/selftests/arm64/fp/fp-stress.c index faac24bdefeb9436e2daf20b7250d0ae25ca23a7..71d02c701bf56be56b7ad00a5f6614e33dc8e01b 100644 --- a/tools/testing/selftests/arm64/fp/fp-stress.c +++ b/tools/testing/selftests/arm64/fp/fp-stress.c @@ -28,6 +28,9 @@ #define MAX_VLS 16 +#define SIGNAL_INTERVAL_MS 25 +#define LOG_INTERVALS (1000 / SIGNAL_INTERVAL_MS) + struct child_data { char *name, *output; pid_t pid; @@ -449,7 +452,7 @@ static const struct option options[] = { int main(int argc, char **argv) { int ret; - int timeout = 10; + int timeout = 10 * (1000 / SIGNAL_INTERVAL_MS); int cpus, i, j, c; int sve_vl_count, sme_vl_count; bool all_children_started = false; @@ -505,7 +508,7 @@ int main(int argc, char **argv) have_sme2 ? "present" : "absent"); if (timeout > 0) - ksft_print_msg("Will run for %ds\n", timeout); + ksft_print_msg("Will run for %d\n", timeout); else ksft_print_msg("Will run until terminated\n"); @@ -578,14 +581,14 @@ int main(int argc, char **argv) break; /* - * Timeout is counted in seconds with no output, the - * tests print during startup then are silent when - * running so this should ensure they all ran enough - * to install the signal handler, this is especially - * useful in emulation where we will both be slow and - * likely to have a large set of VLs. + * Timeout is counted in poll intervals with no + * output, the tests print during startup then are + * silent when running so this should ensure they all + * ran enough to install the signal handler, this is + * especially useful in emulation where we will both + * be slow and likely to have a large set of VLs. */ - ret = epoll_wait(epoll_fd, evs, tests, 1000); + ret = epoll_wait(epoll_fd, evs, tests, SIGNAL_INTERVAL_MS); if (ret < 0) { if (errno == EINTR) continue; @@ -625,8 +628,9 @@ int main(int argc, char **argv) all_children_started = true; } - ksft_print_msg("Sending signals, timeout remaining: %d\n", - timeout); + if ((timeout % LOG_INTERVALS) == 0) + ksft_print_msg("Sending signals, timeout remaining: %d\n", + timeout); for (i = 0; i < num_children; i++) child_tickle(&children[i]); From patchwork Wed Oct 30 00:02:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13855783 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 07ACDD7494F for ; Wed, 30 Oct 2024 00:07:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zQlC6a/DLB3B5mGhxNgEj8cUMCm/SUrzGtm2ZRTh0EU=; b=WKHdAlxTEuTapxfGH9ilM4YL6/ RJqcOKamgybOJHsXg2Hp5JcE9mSokb3ZGovNDbuYi4yEgTKzsE4uUquTpCT86PfjqvBXHvmOKWVvo npcDAcR0IxyLqB0vq3pgjNk9A08NvjkgAOBC1wHoAYFo7XK85pl88oAazJyc6LwS2A1jg3KH1kZ5f ripVcQ+5ZTcs18xmtYAkWNBLPQKdC2W1NlYzdwrKyZnS9KMbd2PVEW4qdan2SVJ1R8tzEZHuwb3FZ tmE2qrd98cV+uCzmqRxGoRoGzxM5lbFX9VQcyoMAdPuyctEdr0QEKBTKurkRti2bMSEbV8yQgA50G 5tLDi/gw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t5wFB-0000000GISv-0hyk; Wed, 30 Oct 2024 00:07:25 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t5wAH-0000000GI66-2iii for linux-arm-kernel@lists.infradead.org; Wed, 30 Oct 2024 00:02:22 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 21522A43627; Wed, 30 Oct 2024 00:00:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40EF6C4CEE6; Wed, 30 Oct 2024 00:02:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730246540; bh=23oJHFxrvuSewIwap7rSA/8FNEEUIPofhXCAsl9/RTM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=JTqSzKPPcQ3dsKDHLaUvm+5/qTGg82iIoB0/XMkkvTmif22ycFYV5U1D8zoNn+Cad sVg++jviHkAluFHIPsCDrqOLFFKbQaG+TKYrLgJZvIqqxFOav3JQ7TIzG00wVSaMkH HT71oYWQePg2sDU0ykkUxvapEdOmXzMn8LjZUKV+dSUyQY2e2MQJCXs9P5XDZorP/Y Du9qVZ+C35k5AanWtgb8wekuIx5zvHBzuv04exYqxoL1x2dgJSK9APa7U8H+zGBNOr lfImTpwHyvfFyf0UW0ByjhuKLcEVvdm+Upmkxc1O0rgtZlRGfzowDF/ZXhKlU5yODO FMwpRNuD+yr9w== From: Mark Brown Date: Wed, 30 Oct 2024 00:02:03 +0000 Subject: [PATCH v2 2/2] kselftest/arm64: Poll less often while waiting for fp-stress children MIME-Version: 1.0 Message-Id: <20241030-arm64-fp-stress-interval-v2-2-bd3cef48c22c@kernel.org> References: <20241030-arm64-fp-stress-interval-v2-0-bd3cef48c22c@kernel.org> In-Reply-To: <20241030-arm64-fp-stress-interval-v2-0-bd3cef48c22c@kernel.org> To: Catalin Marinas , Will Deacon , Shuah Khan Cc: Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Brown X-Mailer: b4 0.15-dev-9b746 X-Developer-Signature: v=1; a=openpgp-sha256; l=1959; i=broonie@kernel.org; h=from:subject:message-id; bh=23oJHFxrvuSewIwap7rSA/8FNEEUIPofhXCAsl9/RTM=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBnIXeGVNSBOH+sGSKXore1Gd/kJ/0o+aCmx3u/FLAV 9an02buJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZyF3hgAKCRAk1otyXVSH0BkzB/ 9WJ/5pJEB0/hdewFpULVhgdAGJs6V0VYgs2vsqJ4fF3/+9XVqhkfpBm838MjBME3clAqFmSW7NQPPu hd6MVVNpyxIkCKWQVztJxiGvYr2XmphdMmKiLDDbQx+l9Vgl1pbb2CVlPzbMkF/jv1quOdLjZr8kJc 6LnFa4YJUxJqoFDrlvPVDQVBtTJZWGhs5d+roa+MbaUSHPGHpiTSSjpkv0N9skoYmPHYYrlu/6zHNk aqFZQgJr/XeOmx7Pc4ky8crARqIIZBndN6liHtNL0ftmUW/2+5sA0alwZNowavvNHJNF0ASmaMjMu1 RS/Nf9gXpN+EDY5FncU40JVbGwKzPV X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241029_170221_850742_224E9E3A X-CRM114-Status: GOOD ( 12.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org While fp-stress is waiting for children to start it doesn't send any signals to them so there is no need for it to have as short an epoll() timeout as it does when the children are all running. We do still want to have some timeout so that we can log diagnostics about missing children but this can be relatively large. On emulated platforms the overhead of running the supervisor process is quite high, especially during the process of execing the test binaries. Implement a longer epoll() timeout during the setup phase, using a 5s timeout while waiting for children and switching to the signal raise interval when all the children are started and we start sending signals. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/fp-stress.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/arm64/fp/fp-stress.c b/tools/testing/selftests/arm64/fp/fp-stress.c index 71d02c701bf56be56b7ad00a5f6614e33dc8e01b..4f1ef260ce7a26d24092fe9337714f8c3922070a 100644 --- a/tools/testing/selftests/arm64/fp/fp-stress.c +++ b/tools/testing/selftests/arm64/fp/fp-stress.c @@ -453,6 +453,7 @@ int main(int argc, char **argv) { int ret; int timeout = 10 * (1000 / SIGNAL_INTERVAL_MS); + int poll_interval = 5000; int cpus, i, j, c; int sve_vl_count, sme_vl_count; bool all_children_started = false; @@ -588,7 +589,7 @@ int main(int argc, char **argv) * especially useful in emulation where we will both * be slow and likely to have a large set of VLs. */ - ret = epoll_wait(epoll_fd, evs, tests, SIGNAL_INTERVAL_MS); + ret = epoll_wait(epoll_fd, evs, tests, poll_interval); if (ret < 0) { if (errno == EINTR) continue; @@ -626,6 +627,7 @@ int main(int argc, char **argv) } all_children_started = true; + poll_interval = SIGNAL_INTERVAL_MS; } if ((timeout % LOG_INTERVALS) == 0)