From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.201.34 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796114204; b=rozxOklultNb8LLytoHBEMLKSZZ+npSNXwcfl2eQAQaaPztDsCFuW4SIkOAbFL3WiXco wo5yHtM4aEz9AUtKi3U8qG7t56jDCFeVxQyZr2MONzx9aq/LSSUe2/DRhHlEeRqlwrRKf qhVxMH/4EfWwd8PMibamDPSSbztlP7YbvQoiKPyLRTgwTiezjRUgCsZgq+YJqYc82HCFJ wtdNXMe6jmTL7UPwAdCmR+7efGiDNL93RbGrRiI+6WfF2WQtFFTtgdXHrg1RqWX89p7Qt VoPU2lf8cYqWBA62mqnS5KwZJNdsWuwiTULvhWFcyZYGS4CtB9RP3/NtXDd+bmPlq2Q== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796114204; h=DMARC-Filter:DKIM-Signature:Received:Received: X-MS-Exchange-Authentication-Results:Received-SPF:Received:Received: From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type:X-Originating-IP: X-ClientProxiedBy:X-EOPAttributedMessage:X-MS-PublicTrafficType: X-MS-TrafficTypeDiagnostic:X-MS-Office365-Filtering-Correlation-Id: X-MS-Exchange-SenderADCheck:X-MS-Exchange-AntiSpam-Relay: X-Microsoft-Antispam:X-Microsoft-Antispam-Message-Info: X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=yPcCnQ38iD4K6MSshRHOXtxuAIJpJtsDWQiPzRXnmYc=; b=EZ7Jvw4E5/ySWwFIbqtpuwegrufgYIRvmPmMduWTvoCFISOOp0VjAJVOBGo7Dtx9HJZE k8yWVNPr4+si15d/PLJeaycTWmJFc18QXYndQtgCmuAprq5iKL8pmip33G/+nMAlwLxCt jMSkOBsmclFu7B5U8jzwM7HhGpVI4BwgGZJH4T9jRV98hbZHjkkfpfhpQ/JbgkylOqalD PGaT6frU/e31Jx7H81YDSVQAGh+JWJCYh5xtEXnv81l/nUuPxlJXRHm1NX7bK5/cvLaR2 YKOCyJVHJcZs/9fVQ8i9i3V/keBi2cWZeNyLr8OCb25voKe4jzXUOQYCoikzJYNutzQ== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=C0OPwimD; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.201.34 Received: from PH7PR06CU001.outbound.protection.outlook.com (mail-westus3azon11010034.outbound.protection.outlook.com [52.101.201.34]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B0A4606A32A; Tue, 1 Dec 2026 08:36:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4B0A4606A32A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=C0OPwimD ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EYMddKTAa4hdZpl/LClpnQSou+zb24PzFhb9l3QEYHC2sB9DWIaNZ/Q1/fYPSf22/Cpvi8wTYoHZdTDe1LeiW6LBKYy5Cz85FU1QrJDMLKF2ktvoWRvJLIEmh0hJdJhNbStUjMV0PpWODh+wwBVI9IWqp257StJcqDF5HL0ji1sO2Sxc+q8qbmNxEydYJS5XtCSzxSGWGnfeEEGdDpjRVpPOaWaIEhebsQ+dCXLLNEeIFlLlRdLfA6HHKkBa1xih5Kf/z2lmbAuucj17fELLxDrFQzQl7az6zJiPerHHbgUBIfrjwTOpTAWWbrRN7w9qCEJWLIMo+tkQVZUFRRtssQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yPcCnQ38iD4K6MSshRHOXtxuAIJpJtsDWQiPzRXnmYc=; b=qjr9uQdJhbmsmJxLBYMxRulPU00uQkApSDg0CKkShoi42n514NjA05PpR+tQ/5HDhqv3mOUDFsyq70R1aFzk2y1XTUF9A21yKT3MErxX7jkRCpaBVeKzISsMkTvw3Zio2yGrGsCLWvXUhb6pGTnI5dJ/7VcnD7HrkghnUwicBx960WVoI9sSWny/gUWyiATztVqrSWjg5zg3YC0eMTpXDcPy6EekbpyTtBt65wx8eu4PS+9s02zxAL1OJf4ddwpXJCravxiUiNd/onSK29mfLuOtrno5xff9O5GBAuMZviD1FIW+d9s1eW89XFz7YsUvnQEtYhmrcesRsvXM/Wqfpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yPcCnQ38iD4K6MSshRHOXtxuAIJpJtsDWQiPzRXnmYc=; b=C0OPwimDmKymu0wFFseJKgDlS8heH6MqYLYyBsqT6KhGhNs/Wfw0Ul3py4aUmy7r2ZhRYhf1xNcmCjitWCblnwnMNrNXlBOHIFSPWKtJS6obzK1PrBNg4+CxG0pNYPwnY5nF2fSGd1qPnE6j9S0NGRfRlcrGVhPzqLA/7iUZCuY= Received: from SJ0PR03CA0098.namprd03.prod.outlook.com (2603:10b6:a03:333::13) by PH0PR12MB7861.namprd12.prod.outlook.com (2603:10b6:510:26e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.7; Tue, 1 Dec 2026 08:36:39 +0000 Received: from SJ1PEPF000037A1.namprd04.prod.outlook.com (2603:10b6:a03:333:cafe::1a) by SJ0PR03CA0098.outlook.office365.com (2603:10b6:a03:333::13) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.615.10 via Frontend Transport; Tue, 1 Dec 2026 08:36:39 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF000037A1.mail.protection.outlook.com (10.167.244.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Tue, 1 Dec 2026 08:36:39 +0000 Received: from tapi.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Tue, 1 Dec 2026 02:36:35 -0600 From: Swapnil Sapkal To: , , , , CC: , , , , , , , , Subject: [PATCH v6 5/5] selftests/resctrl: Enable MBM and MBA tests on AMD Date: Tue, 1 Dec 2026 08:34:26 +0000 Message-ID: <20261201083426.26730-6-swapnil.sapkal@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261201083426.26730-1-swapnil.sapkal@amd.com> References: <20261201083426.26730-1-swapnil.sapkal@amd.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF000037A1:EE_|PH0PR12MB7861:EE_ X-MS-Office365-Filtering-Correlation-Id: e7835cb5-274c-4e2c-026a-08df4f863833 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|36860700016|1800799024|82310400026|376014|7416014|261028144727099003|56012099006|261102123227099003|261022075727099003|10067099003|261026121527099003|261026140227099003|261021123027099003|261021121427099003|261022105027099003|261009223027099003|22082099003|5023799004|18002099003|11063799006|6133799003|3023799007; X-Microsoft-Antispam-Message-Info: fBDUpHPvd6ygSoCdJ8OlOSyz8aA8Y+Vha5RtshMHJ9r8xC2HIUgFUwOZW9T7ZlI/giNY4+tQc6ZljpKROT7byfmI08DQ7dPsi7BnfKViiRrNirtRoJwr+Gqa3pE9XFuDWvY/IOnrYkFUosaUEkNBTXcULFC5stetBDMVaUWHviGnkng3WMOgbd/X0xvhibPspgS+vH36nRs67bfdkwWlrNti4QOU+2PPazjKzGu6nHPL6UsVAG30zGxHa/W18F0ietGDLhlDIuR1WoPKAu+ADhyhvxz6zqeH7J0XgRuRZY2UcoR8nYzRWs72cy+nXkZB0kAza+TmlRgQKbJ5cMSMS0ca8tVj2C2/sNNbhjX6FqthXvXg0gOpGo4xwRd7isJKfQC1iHq+ofXi+zo9v2L5I3D5Y+HQUMEE57YxG63u499dypTTVhg1HASr65woeDTAYN51+alSC+swXbiWaKmw13CZmpzdTXRx8JBDrVdnDuGELecegKI4QCA+nP64vEPFP0Oq7B9d6FsybN9Lmnu6jLB2K4K9WKyXUR30t8c7IXVpYtckXBJDLj77JGbSCk3mN6XMiYfou9OSOhL2TPdQPIb++wCWpCp8KlmgX5RSsWO/ZCi3EO9+5wKurbjVJruLtAOif/ASC8TDpIGOzkCd2bK4cIFN8l/dxPNd7nZ84vpj9vTRes8IeTU6k7G+fgMoiGc+8EJB1ss55Pe1bML0Sw== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(36860700016)(1800799024)(82310400026)(376014)(7416014)(261028144727099003)(56012099006)(261102123227099003)(261022075727099003)(10067099003)(261026121527099003)(261026140227099003)(261021123027099003)(261021121427099003)(261022105027099003)(261009223027099003)(22082099003)(5023799004)(18002099003)(11063799006)(6133799003)(3023799007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bjUiZuPZuxZ/NLnKiCLnZXHRgmeIVq9t7CJKuqa2Q5Y80vMSBjHbXJhUPQlsRk1wbfZyW9SUM/lhGk0ch5iLh6nc+IS0j4JUPg4+6wg9tTzwEZKbQ1r4U6TeQZ18/lFlAdWe5mo4MJqfi42YW42ey9+HZoACPqfyia++QHCQigBn25keLdvCKSgxVqq3Jsjym1oxNv6jig53veZFPr/ElSFXeNPJ8Sir8qTQz8BtfkcwR5u1IIfKsebjJdvLpiJO1FeBbsvCZVbukVIDNJGB3PsoXr0vPqWMx7uamyg8hIgNhfBZxkdA9mFWuFgbyuwdqFu/OJv7K7qLsT9DeHqpNV0c8B6KwbnWIpwj5rWX3XtEt07dL00jgBlWpMKfq6ojUuU8jgQPGx/VZ6cmlgHG53ECs/unRWbpHMjctQ4qCDkvAOU7X6KbWPguFl7nxvQI X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2026 08:36:39.6292 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e7835cb5-274c-4e2c-026a-08df4f863833 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF000037A1.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7861 From: Babu Moger Now that the UMC (Unified Memory Controller) perf events can be used to validate the resctrl memory bandwidth numbers on AMD, extend the vendor_specific gate of the MBM and MBA tests to also cover AMD so that they run on AMD in addition to Intel. The tests stay restricted to Intel and AMD: enumerate_mcs() only knows about the iMC and UMC counters, so keeping the gate (rather than making the tests universal) leaves other vendors skipped instead of failing. The MBM test wrote a hardcoded "100" to the memory bandwidth allocation so that the bandwidth it measures is not throttled. That value is only correct where the allocation is a percentage. On AMD the allocation is an absolute bandwidth value in units of 1/8 GB/s, so the write throttled the benchmark to 12.5 GB/s instead of leaving it unthrottled. Drop the write. resctrl is mounted for the duration of each test, so the con_mon grp is created fresh and still carries the resource's default allocation, which is already the maximum. Writing anything would require the test to know whether the allocation is a percentage or an absolute bandwidth value, which is exactly what went wrong. Signed-off-by: Babu Moger Co-developed-by: Swapnil Sapkal Signed-off-by: Swapnil Sapkal --- v5->v6: - Fixed the issue reported by Sashiko: the MBM test wrote a hardcoded "100" to leave the bandwidth unthrottled, which is only correct for the percentage based interface. On AMD the allocation is absolute, so the write throttled the benchmark to 12.5 GB/s. resctrl is mounted per test, so the con_mon grp is always created fresh and already carries the default (maximum) allocation. Drop the write instead of replacing the value: nothing has to know whether the allocation is a percentage or an absolute bandwidth value. (Reinette, Sashiko) v4->v5: - Extended the vendor_specific gate to ARCH_INTEL | ARCH_AMD instead of removing it, so unsupported vendors are skipped rather than failed. tools/testing/selftests/resctrl/mba_test.c | 2 +- tools/testing/selftests/resctrl/mbm_test.c | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/resctrl/mba_test.c b/tools/testing/selftests/resctrl/mba_test.c index ca87396671f0..fe032798ed53 100644 --- a/tools/testing/selftests/resctrl/mba_test.c +++ b/tools/testing/selftests/resctrl/mba_test.c @@ -245,7 +245,7 @@ static bool mba_feature_check(const struct resctrl_test *test) struct resctrl_test mba_test = { .name = "MBA", .resource = "MB", - .vendor_specific = ARCH_INTEL, + .vendor_specific = ARCH_INTEL | ARCH_AMD, .feature_check = mba_feature_check, .run_test = mba_run_test, .cleanup = mba_test_cleanup, diff --git a/tools/testing/selftests/resctrl/mbm_test.c b/tools/testing/selftests/resctrl/mbm_test.c index e24c6237a22f..0aab39647100 100644 --- a/tools/testing/selftests/resctrl/mbm_test.c +++ b/tools/testing/selftests/resctrl/mbm_test.c @@ -102,19 +102,20 @@ static int mbm_setup(const struct resctrl_test *test, const struct user_params *uparams, struct resctrl_val_param *p) { - int ret = 0; - /* Run NUM_OF_RUNS times */ if (p->num_of_runs >= NUM_OF_RUNS) return END_OF_TESTS; - /* Set up shemata with 100% allocation on the first run. */ - if (p->num_of_runs == 0 && resctrl_resource_exists("MB")) - ret = write_schemata(p->ctrlgrp, "100", uparams->cpu, test->resource); - + /* + * The memory bandwidth must not be throttled while it is measured. + * The con_mon grp is created for this test run and so still carries + * the default allocation, which is the maximum, and no schemata needs + * to be written to obtain it. Writing one would need to know whether + * the allocation is a percentage or an absolute bandwidth value. + */ p->num_of_runs++; - return ret; + return 0; } static int mbm_measure(const struct user_params *uparams, @@ -178,7 +179,7 @@ static bool mbm_feature_check(const struct resctrl_test *test) struct resctrl_test mbm_test = { .name = "MBM", .resource = "MB", - .vendor_specific = ARCH_INTEL, + .vendor_specific = ARCH_INTEL | ARCH_AMD, .feature_check = mbm_feature_check, .run_test = mbm_run_test, .cleanup = mbm_test_cleanup, -- 2.43.0