Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp45616lqj; Wed, 10 Apr 2024 03:35:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXzUKxojNiwVcBKntgMOxmHEHMonupcay5gKzKnTxiZ6XBfgmCwOh7ZVQrhR8MT75QlMnCFPutMgRYOHwJSe42yi8nEkZ03Hqf5ukSdKw== X-Google-Smtp-Source: AGHT+IErSC2VqvGNhccAR/WSozPFDGZX5J59/ITbpCYQcfbJ/yKeBHuyDEh9Tr/Cu249vn1mT1yI X-Received: by 2002:a05:6808:1288:b0:3c5:f567:c58b with SMTP id a8-20020a056808128800b003c5f567c58bmr2062983oiw.38.1712745345015; Wed, 10 Apr 2024 03:35:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712745344; cv=pass; d=google.com; s=arc-20160816; b=E6paW57Jb48KJw3L84WBRSJcIapMBYQukYeu8lE7RI36RzhRM45O/bsYdQl95pifCR ZAu9PQxG1CHcZmpDoOSIQssCUftV4Am6p013TZorroNKoavmmBZLfgxi1q3AUp2XPrMM 6TOtK24+xNj9udlI+Fooip/UL1ujugu5UuIFet0Fzx7ic/R6zLKFvyBhqpVMF/05zmgO OLMRTJOhuSf57vC8b/34vIbh5Os3wV/3LMXsleXaA5k8nb7gBEDEAyXRkk1RD8TFiQdI Dslyyt6B4J89IuFuOvz0IcyPCygm8s7c65CDBcbz8zdcHj7BIjl86BrvTKnjVpE9Mtev beNw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=RKms7K4DRT/kZzfg5ze7pevJ2kI9mMupDAK+5QHpqS4=; fh=Nx34APoIcnJ0+S23bfWBcqFDEk6NNmFHNRxZpQVNwlY=; b=soP65pJtrOZ5arig+XUDwX+5DfXXNckP1FBcjLa0x4KJXCK4eoe871ABXgD674ens6 9w0f5x9wbFQxy34cQC7c3NyPeETmQQB4oO2AltSUBhsd2/36MyfnMXuQ51FzwXDEvQvt 7sAFTZCrqpqCIo5DOUjbUar4ilwEPX5gJtIzR/T4WDVr/i8eqfMKePfm+rbu132h84Ma IeKXx5Gfj09F6YrYnj1TqtUSUhjTDUXbX2/YYylbwQwNfx9uZI7fix8X1poeYywhWEeH A8T3XAre0vg4eDeEs+5Gs1VSgAAjZeNWkjQ6duIAMPZpxw0iaSYk/Zl/GcJ7mTLsgxh6 n47w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-138334-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138334-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id pi19-20020a05620a379300b0078a3a96b13asi11952331qkn.114.2024.04.10.03.35.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 03:35:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138334-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-138334-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138334-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B7E2D1C2171C for ; Wed, 10 Apr 2024 10:35:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B30B915957D; Wed, 10 Apr 2024 10:35:26 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C99DA1581E5; Wed, 10 Apr 2024 10:35:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712745326; cv=none; b=XNMIhZ/9gym1+7wLypib5VPAtfnBlSwmW6eGpd3AMuU8uZdz1jcLHWpqy02Ah/CuPJMDAqn7HKTpGUVjc01ode1Id3aIfx6YsQIYyJCs5Xlt0eHONeiz/Q8N0ivHvGKSTvv50C+kIpLIXP2syaFHvwCq1RJYeOslFl+D/r/G3eM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712745326; c=relaxed/simple; bh=A4edVE/D8u1t1sQx4i9oqjQfzNIjaTh9JSqLAHcrSms=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nkgPJ0TahU/SL6qA1x312ptKpldmP/0W3aYI6XyDPQps69ZLm1o1GUPW+ErYBsX299TmYYNHb1bxyt6WYALQjJnWhdcoNzBvqfllTngT059aYHb1/SioZyxFZJ8Mi0HY08EJgGv4V+XzJ55M5+aae3mXcGZMiYJaq78U14GijW8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1038B1480; Wed, 10 Apr 2024 03:35:54 -0700 (PDT) Received: from e127643.broadband (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A34263F6C4; Wed, 10 Apr 2024 03:35:21 -0700 (PDT) From: James Clark To: linux-perf-users@vger.kernel.org, irogers@google.com, namhyung@kernel.org Cc: James Clark , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , "Liang, Kan" , Athira Rajeev , Spoorthy S , Leo Yan , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/4] perf tests: Make "test data symbol" more robust on Neoverse N1 Date: Wed, 10 Apr 2024 11:34:52 +0100 Message-Id: <20240410103458.813656-2-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240410103458.813656-1-james.clark@arm.com> References: <20240410103458.813656-1-james.clark@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To prevent anyone from seeing a test failure appear as a regression and thinking that it was caused by their code change, insert some noise into the loop which makes it immune to sampling bias issues (errata 1694299). The "test data symbol" test can fail with any unrelated change that shifts the loop into an unfortunate position in the Perf binary which is almost impossible to debug as the root cause of the test failure. Ultimately it's caused by the referenced errata. Fixes: 60abedb8aa90 ("perf test: Introduce script for data symbol testing") Signed-off-by: James Clark --- tools/perf/tests/workloads/datasym.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/perf/tests/workloads/datasym.c b/tools/perf/tests/workloads/datasym.c index ddd40bc63448..8e08fc75a973 100644 --- a/tools/perf/tests/workloads/datasym.c +++ b/tools/perf/tests/workloads/datasym.c @@ -16,6 +16,22 @@ static int datasym(int argc __maybe_unused, const char **argv __maybe_unused) { for (;;) { buf1.data1++; + if (buf1.data1 == 123) { + /* + * Add some 'noise' in the loop to work around errata + * 1694299 on Arm N1. + * + * Bias exists in SPE sampling which can cause the load + * and store instructions to be skipped entirely. This + * comes and goes randomly depending on the offset the + * linker places the datasym loop at in the Perf binary. + * With an extra branch in the middle of the loop that + * isn't always taken, the instruction stream is no + * longer a continuous repeating pattern that interacts + * badly with the bias. + */ + buf1.data1++; + } buf1.data2 += buf1.data1; } return 0; -- 2.34.1