From nobody Sun Apr 12 04:27:26 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C50FBC00144 for ; Mon, 1 Aug 2022 20:58:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235288AbiHAU5t (ORCPT ); Mon, 1 Aug 2022 16:57:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235126AbiHAU47 (ORCPT ); Mon, 1 Aug 2022 16:56:59 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2079.outbound.protection.outlook.com [40.107.94.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0088F419A9; Mon, 1 Aug 2022 13:56:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KUwXwCrplym9RN+OsWd8/FaTxJHE+gOuXCuovqBilDLIyK10O6cdgWzSI2qtPXzCwHxCnGDCtClacG+AvyGe8BSaElMvsldiI+c5GFw2Yzq65A9zPHVTC/8AvlHhogLdl/SAHrsldFpeCIuJ5HE7RcXnAv+mg9mbfmjgIgH6/XOfKIj9dwj7v6VUmlBJRglWbo+XMg0X+d8g3yRizgIvJXeKo1ESclYU1/vjVIr9jLmcMv6dtrSR9+5IDpPik4bsMIhR68zUzBd6MaoM92uUV5+7rHHA8r6wm0xGXB7/AapNJnxxZ2mWudR+4rUHBI1QajhSmEatIuUc8ZdbBr4OvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=IpmP5Sq4lnk7Jen1kRc+TyLKQQ7YKpPOmvrbvhAjAT0=; b=QCx8kQO4g63p+zGuJOYuVUkCda9lbKkwHeDy3JllaOFnYIu3lq23nm1ItsbFWMfYY86NaEMkuKIKX7xdTb0eM4otPP5gw+sxRGmT2UyZlFvgIsmHYHBgnBo2cwRgqbfNhQjZDQIIdmxOFyu+iB0l9/yeYrFswZX+ZUB5AjemyW6tr56BwSy6MbJ6pJ1pxtTJcqeX3c1lkxi9RQDMdUQfyZBzUFk9FwvIo0xHMIfbE2vgtRB0K7rGuautR1TFU+6K/GKZxochIf0vzK0E/ydPM1idjnof+eqa9o+05QUtsGccVR34mEpJte0PxVC7wVcel5+cs/FIdCYyP8f/ZDcN+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org 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 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=IpmP5Sq4lnk7Jen1kRc+TyLKQQ7YKpPOmvrbvhAjAT0=; b=LHCWpQ1dIwnLoLdLJ9jP6qXosPTDnO8HCjLO4Iq2VAMH/H+s4DJYLaIUmWniDNG08U35BicYSETaIt24XI78VxcoobP7w6VN3vp3jKkcypz4LgWVCAlr6asmC2rEI6snCw8gydqsj3YRaTAo8afRNM2ItvuRqjakzqlcnEpdbRg= Received: from BN9PR03CA0484.namprd03.prod.outlook.com (2603:10b6:408:130::9) by BN9PR12MB5161.namprd12.prod.outlook.com (2603:10b6:408:11a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.11; Mon, 1 Aug 2022 20:56:45 +0000 Received: from BN8NAM11FT059.eop-nam11.prod.protection.outlook.com (2603:10b6:408:130:cafe::22) by BN9PR03CA0484.outlook.office365.com (2603:10b6:408:130::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.25 via Frontend Transport; Mon, 1 Aug 2022 20:56:45 +0000 X-MS-Exchange-Authentication-Results: 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=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT059.mail.protection.outlook.com (10.13.177.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5482.10 via Frontend Transport; Mon, 1 Aug 2022 20:56:45 +0000 Received: from [127.0.1.1] (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 1 Aug 2022 15:56:44 -0500 Subject: [PATCH v2 10/10] Documentation/x86: Update resctrl_ui.rst for new features From: Babu Moger To: , , , , CC: , , , , , , , Date: Mon, 1 Aug 2022 15:56:43 -0500 Message-ID: <165938740360.724959.7059659465268246182.stgit@bmoger-ubuntu> In-Reply-To: <165938717220.724959.10931629283087443782.stgit@bmoger-ubuntu> References: <165938717220.724959.10931629283087443782.stgit@bmoger-ubuntu> User-Agent: StGit/1.1.dev103+g5369f4c MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0e352887-c6c6-4210-ccf8-08da7400586a X-MS-TrafficTypeDiagnostic: BN9PR12MB5161:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +rxmEq/UEkvzboQoGpLV6EXBluszHogPakp5q0WjGmd/1kN3K87BGib8hypPUtcs9ulc3NeklevqSDAS8G4sw4a/IEbC+0jVaisc6dST/rQ3/iyqS5NoyH4lPpxNN3mn8JyEXLye3KnUyUN3oyB5jFpwlZIO2xO+nT59sJH3/NKCbtpZTLZdP3ldNTL+nefeo/db7jhA2alpU06HJzxtESqCZmEZaQHFD9dGTBnSd57f8eeQRLgPijtBP0qbZShcumCPwsqhr2oYUyiORqORP5UgYu9mQ00W/HTpBvVV6e9aMhX03pbxzx9olkTzEUjGMXNMxWXv5x5zMDPr+2zsxnFnyCealx2o3N5waqsf4k9PTjmjwP8QL9DZ92qG3XqsTCVpJXKIRiw+SZ8i9G/EZpA/Qxg3dGuhzc0R8W19I61BXqhxPHUlOgIrEX58wj6DScuNN9yda0Czw9+8T42pIrcNYOzclXSG+RCrkGfRuIYxpkUKfLvGcySAVqIfCy71EKkpaWFeAiYYObLTw4WyJXLQDWCBuq+MImRXa4xzEJDDXsbZcuagMYgcPRaCieJDxuwrCqh/r02EZIF2Ci7N+kd5Kqfi9rfxfyfZvaWfo8U6vs5gLL5PvRXs8GamPRyDqQ3GyM7bBJWjB4TqMSe5nu57SVX0CZTqkne7g3Td+3a5umRAcWwgl3kAjIVp2s+P2XD97ejR+qdJC/UnI15C28BjkD18qo9+4N/qZujzGcJwwpaIB4X0DdPIoK7Qlrk7d6J8NKBWCgNUT+Hden68RcCXDvHR1ag4CAlofqswtPL+3iqg4v4wm07Sy8wzJN0QN0ByAsfpOqtRbbqDaZZr5s99fhTcnPDP88Owwxuoz+c= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230016)(7916004)(4636009)(396003)(39860400002)(136003)(346002)(376002)(36840700001)(46966006)(40470700004)(82740400003)(40480700001)(356005)(16576012)(316002)(81166007)(54906003)(110136005)(36860700001)(33716001)(82310400005)(70206006)(426003)(336012)(9686003)(40460700003)(26005)(47076005)(41300700001)(15650500001)(83380400001)(70586007)(4326008)(478600001)(186003)(16526019)(5660300002)(8936002)(103116003)(44832011)(7416002)(2906002)(8676002)(86362001)(71626007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2022 20:56:45.7937 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0e352887-c6c6-4210-ccf8-08da7400586a 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT059.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5161 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Update the documentation for the new features: 1. Slow Memory Bandwidth allocation. With this feature, the QOS enforcement policies can be applied to the external slow memory connected to the host. QOS enforcement is accomplished by assigning a Class Of Service (COS) to a processor and specifying allocations or limits for that COS for each resource to be allocated. 2. Bandwidth Monitoring Event Configuration (BMEC). The bandwidth monitoring events mbm_total_bytes and mbm_local_bytes are set to count all the total and local reads/writes respectively. With the introduction of slow memory, the two counters are not enough to count all the different types are memory events. With the feature BMEC, the users have the option to configure mbm_total_bytes and mbm_local_bytes to count the specific type of events. Added the instructions to configure with examples. Signed-off-by: Babu Moger --- Documentation/x86/resctrl.rst | 123 +++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 123 insertions(+) diff --git a/Documentation/x86/resctrl.rst b/Documentation/x86/resctrl.rst index 71a531061e4e..ba6833171c0a 100644 --- a/Documentation/x86/resctrl.rst +++ b/Documentation/x86/resctrl.rst @@ -167,6 +167,12 @@ with the following files: bytes) at which a previously used LLC_occupancy counter can be considered for re-use. =20 +"mon_configurable": + Provides the information if the events mbm_total and + mbm_local are configurable. See the configuration + details for "mbm_total_config" and "mbm_local_config" + for more information. + Finally, in the top level of the "info" directory there is a file named "last_cmd_status". This is reset with every "command" issued via the file system (making new directories or writing to any of the @@ -264,6 +270,29 @@ When monitoring is enabled all MON groups will also co= ntain: the sum for all tasks in the CTRL_MON group and all tasks in MON groups. Please see example section for more details on usage. =20 +"mbm_total_config": +"mbm_local_config": + This contains the current event configuration for the events + mbm_total_bytes and mbm_local_bytes, respectively, when the + Bandwidth Monitoring Event Configuration (BMEC) feature is support= ed. + These files are organized by L3 domains under the subdirectories + "mon_L3_00" and "mon_L3_01". When BMEC is supported, the events + mbm_local_bytes and mbm_total_bytes are configurable. + + Following are the types of events supported. + Bits Description + 6 Dirty Victims from the QOS domain to all types of memory + 5 Reads to slow memory in the non-local NUMA domain + 4 Reads to slow memory in the local NUMA domain + 3 Non-temporal writes to non-local NUMA domain + 2 Non-temporal writes to local NUMA domain + 1 Reads to memory in the non-local NUMA domain + 0 Reads to memory in the local NUMA domain + + By default, the mbm_total_bytes configuration is set to 0x7f to co= unt + all the event types and the mbm_local_bytes configuration is set to + 0x15 to count all the local memory events. + Resource allocation rules ------------------------- =20 @@ -464,6 +493,14 @@ Memory bandwidth domain is L3 cache. =20 MB:=3Dbw_MBps0;=3Dbw_MBps1;... =20 +Slow Memory bandwidth Allocation (when supported) +------------------------------------------ + +Slow Memory b/w domain is L3 cache. +:: + + SB:=3Dbandwidth0;=3Dbandwidth1;... + Reading/writing the schemata file --------------------------------- Reading the schemata file will show the state of all resources @@ -479,6 +516,44 @@ which you wish to change. E.g. L3DATA:0=3Dfffff;1=3Dfffff;2=3D3c0;3=3Dfffff L3CODE:0=3Dfffff;1=3Dfffff;2=3Dfffff;3=3Dfffff =20 +Reading/writing the schemata file (on AMD systems) +--------------------------------------------------------------- +Reading the schemata file will show the state of all resources +on all domains. When writing the memory bandwidth allocation you +only need to specify those values in an absolute number expressed +in 1/8 GB/s increments. To allocate bandwidth limit of 2GB, you +need to specify the value 16 (16 * 1/8 =3D 2). E.g. +:: + + # cat schemata + MB:0=3D2048;1=3D2048;2=3D2048;3=3D2048 + L3:0=3Dffff;1=3Dffff;2=3Dffff;3=3Dffff + + # echo "MB:1=3D16" > schemata + # cat schemata + MB:0=3D2048;1=3D 16;2=3D2048;3=3D2048 + L3:0=3Dffff;1=3Dffff;2=3Dffff;3=3Dffff + +Reading/writing the schemata file (on AMD systems) with slow memory +--------------------------------------------------------------- +Reading the schemata file will show the state of all resources +on all domains. When writing the memory bandwidth allocation you +only need to specify those values in an absolute number expressed +in 1/8 GB/s increments. To allocate bandwidth limit of 8GB, you +need to specify the value 64 (64 * 1/8 =3D 8). E.g. +:: + + # cat schemata + SB:0=3D2048;1=3D2048;2=3D2048;3=3D2048 + MB:0=3D2048;1=3D2048;2=3D2048;3=3D2048 + L3:0=3Dffff;1=3Dffff;2=3Dffff;3=3Dffff + + # echo "SB:1=3D64" > schemata + # cat schemata + SB:0=3D2048;1=3D 64;2=3D2048;3=3D2048 + MB:0=3D2048;1=3D2048;2=3D2048;3=3D2048 + L3:0=3Dffff;1=3Dffff;2=3Dffff;3=3Dffff + Cache Pseudo-Locking =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D CAT enables a user to specify the amount of cache space that an @@ -1210,6 +1285,54 @@ View the llc occupancy snapshot:: # cat /sys/fs/resctrl/p1/mon_data/mon_L3_00/llc_occupancy 11234000 =20 +Example 5 (Configure and Monitor specific event types) +------------------------------------------------- + +A single socket system which has real time tasks running on cores 0-4 +and non real time tasks on other CPUs. We want to monitor the memory +bandwidth allocation for specific events. +:: + + # mount -t resctrl resctrl /sys/fs/resctrl + # cd /sys/fs/resctrl + # mkdir p1 + +Move the CPUs 0-4 over to p1:: + + # echo 0xf > p1/cpus + +View the current mbm_local_bytes:: + + # cat /sys/fs/resctrl/p1/mon_data/mon_L3_00/mbm_local_bytes + 112501 + +Change the mbm_local_bytes to count mon-temporal writes to both local +and non-local NUMA domain. Refer to event supported bitmap under +mbm_local_config:: + + # echo 0xc > /sys/fs/resctrl/p1/mon_data/mon_L3_00/mbm_local_config + +View the updated mbm_local_bytes:: + + # cat /sys/fs/resctrl/p1/mon_data/mon_L3_00/mbm_local_bytes + 12601 + +Similar experiment on mbm_total_bytes. First view the current mbm_total_by= tes:: + + # cat /sys/fs/resctrl/p1/mon_data/mon_L3_00/mbm_total_bytes + 1532501 + +Change the mbm_total_bytes to count only reads to slow memory on both local +and non-local NUMA domain. Refer to event supported bitmap under +mbm_total_config:: + + # echo 0x30 > /sys/fs/resctrl/p1/mon_data/mon_L3_00/mbm_total_config + +View the updated mbm_total_bytes:: + + # cat /sys/fs/resctrl/p1/mon_data/mon_L3_00/mbm_total_bytes + 104562 + Intel RDT Errata =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20