From patchwork Thu Jul 30 18:09:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 247287 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2656641ilg; Thu, 30 Jul 2020 11:37:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzF8GzosGMHNlIaTvYMRfoezeYXZadyHmei4H9Cwp0n0Ze846LzdaHDyQBcl7DvEFv4hMXe X-Received: by 2002:a17:906:c24e:: with SMTP id bl14mr403140ejb.285.1596134244784; Thu, 30 Jul 2020 11:37:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596134244; cv=none; d=google.com; s=arc-20160816; b=RVYILPn6JKumsaVuGJjoe0v5ehdZd25MwGtYtOQrHz07HyoIelqpRP4piyf3GzTOmr m8lhp40fw03jofFypZd2Y6/JzUHfSdoDcxxARhYHjabi7uaGA/RKw4i3WoHuwOD4JCZm r9/Lh3Uvge14P0fuj1dGlLhK9F2QCNqXzkzgulmrrGplecNDHAh9eOhL58RKPnOoKsly NfCYr+ro9949Rgc6WE23cFeJ/u/FPJXhJcGrxVmcle+W6dxhIlB0Gx7Qd3BVLdfk87MI EiDX1DPzGx+p76wYXXi5SUdQNRaM0eLCrIbj6fI55BEMKLG3O1Oqh6pBIvGbqLY5HD+N cCEw== 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=jWIQP7d4t4SP01Ni3YLfS7MyVhwqYR0eZ7qdMkNG+C27S8pXKxMql1JQMKT4SVVBps tQrtW2odyWGTF5q0ZK1Q5UbJ/xwTz9/VIX2t4mznnfUS0CFquCfDvT7S4OT2INxqqNeY 0q5YXX9gs2X5l50wOT/EtIch740TfAHWl+kFqT7UxkcU5exzrAaKR3P1cCIhQCYn7gSr 2adBzuPEtf90udbHVe08GfaaxaiCVKLul7UTn1qr+EZu4b4pRO9s8qfNjgOKaE68T9fY C3UKzDj7uIANyR6+VXDw1vj4MOeMM+tCSWO7xnPaV55ude8lKbl8wbgfr9lSFjf/7cWC Gh7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ey4XAGD1; 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 rn4si4022473ejb.29.2020.07.30.11.37.24; Thu, 30 Jul 2020 11:37:24 -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=Ey4XAGD1; 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 S1730374AbgG3ShY (ORCPT + 6 others); Thu, 30 Jul 2020 14:37:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:57424 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730275AbgG3ShW (ORCPT ); Thu, 30 Jul 2020 14:37: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 EB60E2083B; Thu, 30 Jul 2020 18:37:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596134241; bh=F1AYrEcZ7mpD0EYEJHQ5gNlFCjBTpcbcw3WgaRKBGUQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ey4XAGD1gH8xyBmOIPLVPVwtgpdy8kCTkGlP9rlY0ak+66cD/EchmZOJuzD8J/nHs MBMNzdyIm3+jEjSFqKYq8jfqnUNg9phyg11gUyvw9HGMhZYYIN7PECePhEqcrd2YOs B3tvkH+A7Ze0XD3JSmVYdsBB2Fgf+rB4nO2fYgaY= From: Mark Brown To: Catalin Marinas , Will Deacon , Shuah Khan , Dave Martin Cc: linux-kselftest@vger.kernel.org, Mark Brown Subject: [PATCH 5/6] selftests: arm64: Add wrapper scripts for stress tests Date: Thu, 30 Jul 2020 19:09:19 +0100 Message-Id: <20200730180920.23527-6-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200730180920.23527-1-broonie@kernel.org> References: <20200730180920.23527-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