Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1201549rdg; Fri, 13 Oct 2023 13:26:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHOIEyfqW2sHtJbX66Wkb+81KFA2oYSskVZ2Taz5bcC02Zwym9ZB91wTRXrzQ4rE9PY6bHy X-Received: by 2002:a05:6a21:197:b0:15e:f2a1:dae with SMTP id le23-20020a056a21019700b0015ef2a10daemr1660058pzb.27.1697228811742; Fri, 13 Oct 2023 13:26:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697228811; cv=pass; d=google.com; s=arc-20160816; b=M5n9MD7zdTUjyY3ixxzFFC09cUR5Re3hm4jWNaulmvr7M49Q0ponQoFbl0JcTlTQZs lcFjKCrR1/2CWtlAoRBilU9YVxcbiVVDqmX2NSPpgOrnT6ZaqLqDck2fboOq7I3+c1DY mf8uGm2jWvLXrEbF/7QP6bCQrPIfAT/YVXfQBsde6cuAkGX3Jb1Il9JzfG5L5ASZZt76 oCKs4wAzajM4Mr7n7qVlPGOxwvOLN8ODQNAwEK1rVUorDgXcRfp/k06UBlPxRMyOrAxh 9l49zQYLU9ykFjgZAh25kaghehHVW9fE57Xn5/Pht4Ru9Me3+BuIs4PO3xJw7YaufAKH Hpow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=W+cuwXqDoO6EAY1Xh2HSt3VpcRgwcwOk8iItpy7V0MI=; fh=a8QQDpsyeps30vd5Li+WI6v6dtcd7xKVvftia9bksQM=; b=lgP+4iUAt0SPjaT1oTaihvcNMVHIEGU/3DzZ7WSFzXR52MYpfJlaplSMYpK3hqgC92 cJpJwvglja5NKZa/8S0a0YzTXk3Q6GFoTJybD2kTDhvvf0AlJ9h1wBn6wm6PXufA1+Hu fjipG+ovmKtsrhcrTMWBs3A69jxJoSPF0u+1YVAgvgrrIn/Rln/BcqRkgwTtP9aUfSAt vpY9aB/e80QXNRiH3q6XrveeA26603QALesSYV0TqoQpebIdvCA+5LlJMtnvqGQE/FSf uwW/LTgSZvnnpa2KHdRKWaMuwSQF1cShuQhtRHjbkfN8L/G5HMnUP3K5V6fcVCjQgCpV M08w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=HTVIWoO0; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id j6-20020a633c06000000b005aa0e7d39f4si2753016pga.733.2023.10.13.13.26.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 13:26:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=HTVIWoO0; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 71536802DBBD; Fri, 13 Oct 2023 13:26:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232103AbjJMU03 (ORCPT + 99 others); Fri, 13 Oct 2023 16:26:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231942AbjJMU0V (ORCPT ); Fri, 13 Oct 2023 16:26:21 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2082.outbound.protection.outlook.com [40.107.92.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E38883; Fri, 13 Oct 2023 13:26:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eCom/2oe2jO4XLcqsCEDy6PVP4bRr3HeaVa7cWSekZ1Eq1W+o6H0kItvsgIHVAPe5jOFnShqjJ/uvv0wAkSeCYroZRXyVlOJorP3Jm6GdlpjqQFsdcdcuCAmPZu1l4WRuzjZ8ZrA1RNTDdRbIGeaxgbqaMKmnHV38adqPbpvqNkAivbXb3TL9+S0n5kjXj3LP2AEjKEEQE840QuPa6jELNLMHzX+NRjKnil7xKKbJ6TkinC+9SHfwblMX0oGQVL/4B+nDv0fvMM4KUNlBxdyduliQkHTipcxU3YxxBe4EYftiy/fv6xQbnaYDntWTzshTq0M2hb0dfOVDfbPyet1rw== 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=W+cuwXqDoO6EAY1Xh2HSt3VpcRgwcwOk8iItpy7V0MI=; b=WSKU3U8YNJ6zwpOGuRB8zLV/EbmAO70jRFdwpbBf98ETuVREHlp/2Iy1ncZMH00w1TQuUoc/d2ODUDor2xTXf/dY9BUcr9mPE7ppQoMzMym6bxOgOvyNZb1BWn2Sb8WbgHEesmT8U3mVTZQg2sIwVgFn6pV6GhmgMq+uJQgEV0DfKaRu/klEpzOMuMmbPs+ED2cbM+xwpkyCpHmepoNMcjrySWnEsLKPKhB0WUk6jX/dKrVLTav3hQF3ZP737Ce/GsnZVOKrERbThVVGBbhAr4dPSGp8K4dRXTtdJtDEw1GyRU9QBUi/ieuHKulDmciKdRSY3jw6OHBQQDTcjfyyaA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lwn.net 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=W+cuwXqDoO6EAY1Xh2HSt3VpcRgwcwOk8iItpy7V0MI=; b=HTVIWoO0Qp5BK+ea5i2uIvclK81MTUpoEQEee3su6pNyo0DmxUe3JLJpVfAFFZsL7ZvrnHu0zsg7aMM1asknpYeQ2NaqbA2K9VizDzu/OocbB53H77NmbiejMW41bR9ewU1IhjF0RQxW3+AUbZqVAwFRCy9OOhDTWNkDpg2e5/0= Received: from DS7PR03CA0358.namprd03.prod.outlook.com (2603:10b6:8:55::7) by PH0PR12MB5500.namprd12.prod.outlook.com (2603:10b6:510:ef::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.44; Fri, 13 Oct 2023 20:26:17 +0000 Received: from DS1PEPF0001709A.namprd05.prod.outlook.com (2603:10b6:8:55:cafe::68) by DS7PR03CA0358.outlook.office365.com (2603:10b6:8:55::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.27 via Frontend Transport; Fri, 13 Oct 2023 20:26:17 +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 DS1PEPF0001709A.mail.protection.outlook.com (10.167.18.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.22 via Frontend Transport; Fri, 13 Oct 2023 20:26:17 +0000 Received: from bmoger-ubuntu.amd.com (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.2507.27; Fri, 13 Oct 2023 15:26:15 -0500 From: Babu Moger To: , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v13 04/10] x86/resctrl: Add comments on RFTYPE flags hierarchy Date: Fri, 13 Oct 2023 15:25:56 -0500 Message-ID: <20231013202602.2492645-5-babu.moger@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231013202602.2492645-1-babu.moger@amd.com> References: <20231013202602.2492645-1-babu.moger@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001709A:EE_|PH0PR12MB5500:EE_ X-MS-Office365-Filtering-Correlation-Id: 7983b7a7-44fc-4373-b2e6-08dbcc2aa772 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ceYtmxmh1aVJ1Whj95nYdhj6N5NGw+6QVjurNLpIM+P8W6aVLzoZumj0NHIphOF1gKDJEXFatF5LgrFjAeJub4Tw/rW9EG9MAcWnyrwsIJc8Sd3+rcFernZ4bIz9PRl42Jgjhy4dsdleeutRqBMl+5nhqw0FmVX6pyNKxP82qXFLBWEOEwu3sH8LeUpOUKHIpL2HhH3CFvwOgjLNtsOhR4K9uQSb1NNz/VUUXn0sTnnrTOyJfVdwZitjm+RWvRyZUZRMcIzvCDHxk17JYtgJITbfgR0YKfgcfrVaO8PvE2eCmH8T6Cg5vapEkvYCB222TMJXce/4kPmVHL+R7X1NdeaYaVe627ahxjq4TI7Gwb56mGHkCTcoQ3GOjYnZSWhGgnKuJhDhsnVShF6owxQGpj7AA3Vj4DKj09uYRIJUWmUbHsKGpGQPo9jGBq7L9HvYRavB2tBx9BwhIWoiCPdwhSjY16hDdr1GCEZrwZemh2IPzm81QuQVuxdSykpl08ZbqSy+VL77TfMcwVqQSF1TLi70LcWAW0cKGmWfaLGAejQarUeLRKPRrubkypJDovUxnvwrXgcStq7LBmYgBlZc3p0kjGWfKtzSi840j27v6W0vjmnQ0RicDSbSricZU09aQX8ghRSrY9suw1sYFxUACNEJ4Fp/fwAI1kUnBIc9VMjXCY+EjG3+yayMslUOnazN1rjBl/hBP5aH5cLbV8K470+wgScNuObGg6hDB6T/LnX8Ur5JqgLA2IWlljJvhtPkaBDBnUab0hlsax0blXjQDQ== 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:(13230031)(4636009)(346002)(396003)(376002)(136003)(39860400002)(230922051799003)(451199024)(186009)(82310400011)(64100799003)(1800799009)(40470700004)(36840700001)(46966006)(8936002)(82740400003)(36860700001)(2616005)(7696005)(6666004)(478600001)(86362001)(47076005)(336012)(426003)(110136005)(316002)(26005)(70206006)(70586007)(1076003)(16526019)(54906003)(8676002)(5660300002)(41300700001)(44832011)(7406005)(4326008)(7416002)(81166007)(40460700003)(2906002)(40480700001)(356005)(36756003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2023 20:26:17.2280 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7983b7a7-44fc-4373-b2e6-08dbcc2aa772 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: DS1PEPF0001709A.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB5500 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 13 Oct 2023 13:26:49 -0700 (PDT) resctrl uses RFTYPE flags for creating resctrl directory structure. Definitions and directory structures are not documented. Add comments to improve the readability and help future additions. Signed-off-by: Babu Moger --- v13: Fixed the format issues in the documentation. Needed few minor format changes to address the syntax issues.(Reinette) Removed "Reviewed-by and Tested-by" flags as the patch has changed. v12: Moved the comments from arch/x86/kernel/cpu/resctrl/internal.h to Documentation/arch/x86/resctrl.rst. (Boris) --- Documentation/arch/x86/resctrl.rst | 64 ++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/Documentation/arch/x86/resctrl.rst b/Documentation/arch/x86/resctrl.rst index 178ab1d8f747..1163da74f734 100644 --- a/Documentation/arch/x86/resctrl.rst +++ b/Documentation/arch/x86/resctrl.rst @@ -369,6 +369,70 @@ When monitoring is enabled all MON groups will also contain: 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. +RESCTRL filesystem implementation notes +======================================= +RESCTRL filesystem has two main components + a. info + b. base + + /sys/fs/resctrl/ + | + -> info + | + | (Top level directory named "info". Contains files that + | provide details on control and monitoring resources") + | + -> base + + (Root directory associated with default resource group as + well as directories created by user for MON and CTRL groups. + Contains files to interact with MON and CTRL groups) + + Note: resctrl uses flags for files, not for directories. + Directories are created based on the resource type. Added + directories below for better understanding. The RFTYPE flags + are defined in arch/x86/kernel/cpu/resctrl/internal.h. + + info directory structure + + -> RFTYPE_INFO + Directory: info + + -> RFTYPE_TOP (Files in top level of info directory) + File: last_cmd_status + + -> RFTYPE_MON (Files for all monitoring resources) + Directory: L3_MON + Files: mon_features, num_rmids + + -> RFTYPE_RES_CACHE (Files for cache monitoring resources) + Directory: L3_MON + Files: max_threshold_occupancy, + mbm_total_bytes_config, + mbm_local_bytes_config + + -> RFTYPE_CTRL (Files for all control resources) + Directories: L2, L3, MB, SMBA, L2CODE, L2DATA, L3CODE, L3DATA + File: num_closids + + -> RFTYPE_RES_CACHE (Files for cache control resources) + Directories: L2, L3, L2CODE, L2DATA, L3CODE, L3DATA + Files: bit_usage, cbm_mask, min_cbm_bits, + shareable_bits + + -> RFTYPE_RES_MB (Files for memory control resources) + Directories: MB, SMBA + Files: bandwidth_gran, delay_linear, + min_bandwidth, thread_throttle_mode + + base directory structure + + -> RFTYPE_BASE (Files common for both MON and CTRL groups) + Files: cpus, cpus_list, tasks + + -> RFTYPE_CTRL (Files for CTRL group) + Files: mode, schemata, size + Resource allocation rules ------------------------- -- 2.34.1