From patchwork Wed Aug 19 11:48:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 247954 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp389752ils; Wed, 19 Aug 2020 04:53:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzp9wu/PP9idgk4GVuOY9sxbMWw7qKVy6PQoCrMJrh6c7nZcjrFcuaRm0LqsCoD/wczTaVF X-Received: by 2002:a17:906:5ad8:: with SMTP id x24mr23671674ejs.329.1597837986979; Wed, 19 Aug 2020 04:53:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597837986; cv=none; d=google.com; s=arc-20160816; b=gx81dU4Dsv+ssIHdvkzpjFLJq+3Jt6URqAjeAjBfccnVXOmFkF04x/tsu39Nv8t/p7 m3l9BMBgwQa2u1W/P8cXymuDa+ZvQG3ToOompyfX6ski9nKW8wdW8v25FkOFI+2ZKSjZ vjhcRtZsQHUm6S5QWwxNislfqFRuHl69DOWfN/nHcYGnEQ1UXKGm8WEHpMQk20uZyzqp Q/znG434XQ2RIQ1UT7Qvn4yL4hZvZOA/kG3grueNZqybehjQvIIXaWh+lFfa9060WOv+ 0hEEYllN4ckNYWsaRJInYoprI5FY3Yp6XpyntKDMybgsF2pZhoKyszYbQskgS/HuDBqZ sBHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mjHjU7w00E0tjyc9aORzmCvhFPgHIHH21pTF+P4CKy0=; b=SqoRQQqZ3up96on2ATRYDBa4qPsTJISYEXdwPupd1vO2g+r1hwf3cB8iKTC78TpETe ls11zAfqlhx/JcaOdcuaOqfq462nq+/Ag8gygLRLrHPpnT7Xbwb6InY1booNXZsvjqQG 2AnWR0H84JIMtHJ1xAjhvjtwJJZzEZvb/nM9BOcHWSsZJS7OZhKv3E5U4hAyTH0m4eqY uQqxazpzBB5M4jWodaaDYGy9Qw7lvcvLIiLuDQGc2nmMgL4IbsHC9oHSpxRoYYVz2D4a gbG2ceDpizM4xEoIr8nuvEcPzb7wVKaRMJNyc91U/vLbP8gvWGCXEgENKIOhLjFU9ye0 oBQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Txmtr6Ps; spf=pass (google.com: domain of linux-kselftest-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kselftest-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp14si18607992ejc.125.2020.08.19.04.53.06; Wed, 19 Aug 2020 04:53:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kselftest-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Txmtr6Ps; spf=pass (google.com: domain of linux-kselftest-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kselftest-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727818AbgHSLwG (ORCPT + 6 others); Wed, 19 Aug 2020 07:52:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:54592 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728241AbgHSLvW (ORCPT ); Wed, 19 Aug 2020 07:51:22 -0400 Received: from localhost (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 789752086A; Wed, 19 Aug 2020 11:50:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597837859; bh=F1AYrEcZ7mpD0EYEJHQ5gNlFCjBTpcbcw3WgaRKBGUQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Txmtr6PsMcrpt9rmhvgIVD70xDe8vvlOpTezQHxlsu41FJLiR8ww4J44oNMthar0N 6r5+dO7oWgAs39tIlV+hB1unkNUjbHg4LTULioDdFklsMHDXQkmV679Vq8gUfCSby9 R4Zdt/iCHi/AksfXKaCNPpp1M3exX1TX2whTinvM= From: Mark Brown To: Will Deacon , Catalin Marinas , Shuah Khan , Dave Martin Cc: linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mark Brown Subject: [PATCH v2 5/6] selftests: arm64: Add wrapper scripts for stress tests Date: Wed, 19 Aug 2020 12:48:36 +0100 Message-Id: <20200819114837.51466-6-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200819114837.51466-1-broonie@kernel.org> References: <20200819114837.51466-1-broonie@kernel.org> MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Add wrapper scripts which invoke fpsimd-test and sve-test with several copies per CPU such that the context switch code will be appropriately exercised. Signed-off-by: Mark Brown --- .../testing/selftests/arm64/fp/fpsimd-stress | 60 +++++++++++++++++++ tools/testing/selftests/arm64/fp/sve-stress | 59 ++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100755 tools/testing/selftests/arm64/fp/fpsimd-stress create mode 100755 tools/testing/selftests/arm64/fp/sve-stress -- 2.20.1 diff --git a/tools/testing/selftests/arm64/fp/fpsimd-stress b/tools/testing/selftests/arm64/fp/fpsimd-stress new file mode 100755 index 000000000000..781b5b022eaf --- /dev/null +++ b/tools/testing/selftests/arm64/fp/fpsimd-stress @@ -0,0 +1,60 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0-only +# Copyright (C) 2015-2019 ARM Limited. +# Original author: Dave Martin + +set -ue + +NR_CPUS=`nproc` + +pids= +logs= + +cleanup () { + trap - INT TERM CHLD + set +e + + if [ -n "$pids" ]; then + kill $pids + wait $pids + pids= + fi + + if [ -n "$logs" ]; then + cat $logs + rm $logs + logs= + fi +} + +interrupt () { + cleanup + exit 0 +} + +child_died () { + cleanup + exit 1 +} + +trap interrupt INT TERM EXIT +trap child_died CHLD + +for x in `seq 0 $((NR_CPUS * 4))`; do + log=`mktemp` + logs=$logs\ $log + ./fpsimd-test >$log & + pids=$pids\ $! +done + +# Wait for all child processes to be created: +sleep 10 + +while :; do + kill -USR1 $pids +done & +pids=$pids\ $! + +wait + +exit 1 diff --git a/tools/testing/selftests/arm64/fp/sve-stress b/tools/testing/selftests/arm64/fp/sve-stress new file mode 100755 index 000000000000..24dd0922cc02 --- /dev/null +++ b/tools/testing/selftests/arm64/fp/sve-stress @@ -0,0 +1,59 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0-only +# Copyright (C) 2015-2019 ARM Limited. +# Original author: Dave Martin + +set -ue + +NR_CPUS=`nproc` + +pids= +logs= + +cleanup () { + trap - INT TERM CHLD + set +e + + if [ -n "$pids" ]; then + kill $pids + wait $pids + pids= + fi + + if [ -n "$logs" ]; then + cat $logs + rm $logs + logs= + fi +} + +interrupt () { + cleanup + exit 0 +} + +child_died () { + cleanup + exit 1 +} + +trap interrupt INT TERM EXIT + +for x in `seq 0 $((NR_CPUS * 4))`; do + log=`mktemp` + logs=$logs\ $log + ./sve-test >$log & + pids=$pids\ $! +done + +# Wait for all child processes to be created: +sleep 10 + +while :; do + kill -USR1 $pids +done & +pids=$pids\ $! + +wait + +exit 1