From nobody Fri Dec 19 06:19:29 2025 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 C0438C04A6A for ; Fri, 11 Aug 2023 20:09:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236539AbjHKUJ6 (ORCPT ); Fri, 11 Aug 2023 16:09:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236323AbjHKUJ4 (ORCPT ); Fri, 11 Aug 2023 16:09:56 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2068.outbound.protection.outlook.com [40.107.220.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 905E230FC; Fri, 11 Aug 2023 13:09:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QZXKwQ+o6JoTEB3dmwmEJ25zOc6KtmG7D3RJeBX3QMUXEx5Pyon+V3tjMkLRp3ITL7B4PTEFtaAuU7FjGxGgA8RLx7vsPjSxShMW2+7ZenQ7v9r20lF/AN+x/Lm5nFS3AfCTKMDGxeGQQ7GozKz/0CGFPp65On2JPo/Ec4Llcq9ue0cBrLHmXZk3xhtcxxqNZ03STw4B43NcMy5vDRFxXZrhb7gb6McTx7xKsvSaxeT0RagiWzH/FpiTtqZJTixNA0ymdQD43MCdX1yEuqLQvhZiyFTZdnwMrU0yEGaGR53D9wPSZjtyssrJKXHylHfR13+KE52MlAgjzfcPtjbJRg== 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=P+DSIBfIYdaBQQoN1Aahql3oHTBoBm0oXqwHDD+PRts=; b=l0Y9+VoZTclE328xGP2QOrM03dPy+aH6B54dfXKZPDK/gJ48vdyE1qSkmCoromS0UR92aqIEOLgNjNavDvnXAG7DRr84nlvoX3NvOg8SVSa6n8LzmR4yfqNuskPwJwCl5MpZL0GRZ4IyxWUdk7bH5mCSVEzGGnXek7u46yqlchi/xKXt/71MipjTkmDlDozT8AVea9oViIeBgs6BFb0wzA1c3Jv73+YiMVicxsHYru9Pa6bVL2g/naYIofwUHE0q2pMIISyn8ZnqdFAVi+wbiwHunlVsSrykcEKbKgDtE9kbQ/cN8XgUJxZO1++m/rnlL3gzQeWc1XCwbcaQ9N+OzA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=csgroup.eu 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=P+DSIBfIYdaBQQoN1Aahql3oHTBoBm0oXqwHDD+PRts=; b=ggcPmUjcXT9UBnB0uFRBTReUfM6kfZ0BdDwr4E3orfGV4MiyqEVMddJaRcrW8yzyvZS2Z5ldWiRL8dKmnEqc0cIvDjeGAobhilejVTWTHLZkuUfVR5LXwm8Z/QqTN9Jn3uwl7VFulZdM1KCNn0DMJiAYTUF40/Bcm9vQAxVmhFA= Received: from BYAPR04CA0025.namprd04.prod.outlook.com (2603:10b6:a03:40::38) by SA1PR12MB7040.namprd12.prod.outlook.com (2603:10b6:806:24f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.30; Fri, 11 Aug 2023 20:09:51 +0000 Received: from MWH0EPF000971E8.namprd02.prod.outlook.com (2603:10b6:a03:40:cafe::69) by BYAPR04CA0025.outlook.office365.com (2603:10b6:a03:40::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.27 via Frontend Transport; Fri, 11 Aug 2023 20:09:51 +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 MWH0EPF000971E8.mail.protection.outlook.com (10.167.243.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6652.20 via Frontend Transport; Fri, 11 Aug 2023 20:09:51 +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.2507.27; Fri, 11 Aug 2023 15:09:46 -0500 Subject: [PATCH v7 4/8] x86/resctrl: Add comments on RFTYPE flags hierarchy From: Babu Moger To: , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Date: Fri, 11 Aug 2023 15:09:45 -0500 Message-ID: <169178458575.1147205.16331131496340363561.stgit@bmoger-ubuntu> In-Reply-To: <169178429591.1147205.4030367096506551808.stgit@bmoger-ubuntu> References: <169178429591.1147205.4030367096506551808.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-TrafficTypeDiagnostic: MWH0EPF000971E8:EE_|SA1PR12MB7040:EE_ X-MS-Office365-Filtering-Correlation-Id: 13ef6f07-2d4c-4b0d-bdea-08db9aa6ebd5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZHxqMyMD2TTB9H4BOc/NHLiiWk87PIiZ4izraOSNKOykEiA2IzUp++w548om+e4D99zFEnOPjKRNRwHzDA5vVjoy6uOgIRcmlgyGkeIrSO50f+LQPqL8k1+MkfF9V6MMsv9SrIcdDJFUPFpgX5xfyz3aEwdBXuhsiqWG/QOUWfma+4EF6GMWB9533NblXNiHoS1EiDE2SMt8ZmdT/eJ9q8WtGb10JWU8Wv68EQjqkIzTWPOITG6ElWb3I5XPlG1QKB3odWm+SCK+ueVz/IC+DbRYC7Rp/LWW7hNyynZmgp8cbB0MnGbFnTKLLzOgsJ8ClbzooYG0gQ+uMBGZDlXibyv9Yo10eNYE3HPfTkvFU7PTx137V/RskZHOEVIWwoCNcMsKLe7xiMDuS4oKtj5KPtejJcvW2STbiO1c7R7OZFsZhVKF3uwS+ftNT+WF/T/4MIW7YEUi90O7dGptdtg1i4J+4Bms+984uLtcVpbbWV89mkcjQ3s2s5SqIcaLGGmyeTrICFOdyYKtOsAuumZk1kMX3EbTDsDhIavRAJdeY0RQzGvmfnwv7KwDU9HfKf7IaDIH/y6ylBEMezT3B4iKgxmxfXeUImRO6XK11acomJFFvmqdX3q1d2o4aT2gXNE1HUJznxhcn2y3ROxEOcvJT4BRPYdMbC+1463wXZVYWKuKrs0WjTdbvlAUziAvvv78hR9pnXCoo4ZKRLPqorCRWriIAGcP3hB2nuz0PRsLuc9sFGgTbULiIUCzWf3gxIQVd4y6rdMWC4T+UlSS0FDHJgR93x8aP23eQCEOxv6Rlm4= 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:(13230028)(7916004)(4636009)(39860400002)(136003)(346002)(376002)(396003)(186006)(82310400008)(1800799006)(451199021)(46966006)(36840700001)(40470700004)(40480700001)(9686003)(54906003)(110136005)(4326008)(5660300002)(70586007)(70206006)(316002)(16576012)(478600001)(41300700001)(40460700003)(82740400003)(8676002)(26005)(8936002)(44832011)(86362001)(7416002)(33716001)(336012)(7406005)(16526019)(103116003)(47076005)(36860700001)(356005)(81166007)(2906002)(426003)(71626016)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2023 20:09:51.3396 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 13ef6f07-2d4c-4b0d-bdea-08db9aa6ebd5 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: MWH0EPF000971E8.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7040 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- arch/x86/kernel/cpu/resctrl/internal.h | 49 ++++++++++++++++++++++++++++= ++++ 1 file changed, 49 insertions(+) diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/r= esctrl/internal.h index 2051179a3b91..37800724e002 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -240,6 +240,55 @@ struct rdtgroup { =20 /* * Define the file type flags for base and info directories. + * + * 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.) + * + * info directory structure + * ------------------------------------------------------------------ + * --> RFTYPE_INFO + * --> directory + * --> RFTYPE_TOP_INFO + * Files: last_cmd_status + * + * --> RFTYPE_MON_INFO + * --> directory + * Files: max_threshold_occupancy, mon_features, + * num_rmids, mbm_total_bytes_config, + * mbm_local_bytes_config + * + * --> RFTYPE_CTRL_INFO + * Files: num_closids + * + * --> RFTYPE_RES_CACHE + * --> directories + * Files: bit_usage, cbm_mask, min_cbm_bits, + * shareable_bits + * + * --> RFTYPE_RES_MB + * --> directories + * 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_BASE (Files only for CTRL group) + * Files: mode, schemata, size + * */ #define RFTYPE_INFO BIT(0) #define RFTYPE_BASE BIT(1)