From patchwork Fri Sep 15 22:42:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 140743 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1363485vqi; Fri, 15 Sep 2023 15:50:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFV3nLsnWFSYU3G7QHjg/p2B7rU2174zfmVwgFC5oy5sufjVXyb9z2PZlirn7csd6jbVwFG X-Received: by 2002:a05:6a00:1490:b0:690:454a:dc7b with SMTP id v16-20020a056a00149000b00690454adc7bmr3438708pfu.28.1694818218926; Fri, 15 Sep 2023 15:50:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1694818218; cv=pass; d=google.com; s=arc-20160816; b=irbk9vH/CJrUn0F0eXSGhfHc39MqppZD0TX881Dq3tJ0/dbcUUQtrDepYL9tWv8EyK XlOQZbTEAnrgSJB28iTUorn1XGRBqAOjpwUwFG/KYkCqAVG3SQto26fAUvnY1kSuyBe4 RF2BUV8OtoJQotwU1PeK810P0JDcL/KAmz/LlB1inMR2ehpxqgzwJ10yVcNf1rYF8xaN NTrtbC4pxC6IZb+AzqpZirVRd8tpr1obSbNJuw8Y+k+xNb//S9WdHZFc7zAoE0iWEXrT sysQOLUtQSnPPu/6chWfhYWK1J/QY/a8CAw2E6MA3p2dMDYF2wl3Na1pYth1UOsF/2rK 05Dw== 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=aRNwt9E+1bJoLKKiUsRyKY7GIJyJUdLTEXyJaGny0OE=; fh=a8QQDpsyeps30vd5Li+WI6v6dtcd7xKVvftia9bksQM=; b=DhQyJQyrz9Izk4EBVkFQJxQH3CEhgPVXdgzzdw9EBO/CbP+IM3ZznFv7MIKBrY/GbY FWxgZwf8yRC7IKUfH6ah7Zyny/Mqm5min08AR5T1o0HTqQI9Yk+vy/KTzpNaEE00jfCM bOf7BeBwTsmw4exSK4SKT2b4HBb73mJmrMRqlxIzYQkrctG1Euz6zDOUvYXt99KmQRgu 1DWQ/tcKXa6qk84+UBL7zXPMCH5EYX4+oUwaFhWy90nMOED1y314nyZUxYZ/zep6ND1e pjEU9qsIu4OlkSqHqC+Gh4UU/2lLix4uYp0kb0WT2Vg9Hr1p3tYoOeqF930kMyARfMXi qeIg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=ipNln5Ta; 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 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id q7-20020a631f47000000b0057761dd9c56si3841960pgm.322.2023.09.15.15.50.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 15:50:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=ipNln5Ta; 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 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id A3C7D82516C8; Fri, 15 Sep 2023 15:45:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237972AbjIOWnO (ORCPT + 28 others); Fri, 15 Sep 2023 18:43:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237887AbjIOWmu (ORCPT ); Fri, 15 Sep 2023 18:42:50 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2064.outbound.protection.outlook.com [40.107.94.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5F95101; Fri, 15 Sep 2023 15:42:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=caXDvIwhmCpLRbRco7F0KcIkM/6R9Y8g1C08u8NNuuBIAyNjCGr++zI1eQqotf7VMWNkYMIRq8TkGD+4Jv4+Dds8JO9VdnyErDkwOuI0GywC0FYPvYUCz9v+40MnJRinzU8tXJEQvsrufLx39Ry2BqhzwE8CU92NqMKEsZe6Z0fSmQXq+mm3mF0ulr9FDqbLBz8YHjE7HwHkXsFmMpd4P97K3eyZQOkfsQoMN935YlkNnEb7vGfrV116oO1nmo+tDpbta0mqMLdtHdBD1p9nbE4XiOs0A2wPw751lHVF6khd5xhEck1994mHLhIQ1a1MZOU9llYDRNZlemjxpzP3EA== 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=aRNwt9E+1bJoLKKiUsRyKY7GIJyJUdLTEXyJaGny0OE=; b=TqAixs56F0Yb9KfOGsGcTTCLVIwvpiZ1gUA24WN2MAi/8y8elyU1cY7lz1iWg4E2gTKXO1p7EHj3jR4rN2B7gE3/dik/8othXRfjn9ph7ISUSVgfRP4JrUp3nP6Or/Robpi/HAtWun3tO5lZwRtNbeS9NPLhCIycZVwHdm1jJsAeDrUs6/kjLsLs806K0YlETx3a8lzybZPEiyD7ZHVgCvSjd65S2EnrDLmwqFhrBOYy5xjgvI/dK11GndsmZocsCk4L1R23uxLhW14PDuU2O7hnWjhgKMZv6DCkJXN+4K+HmRT0dSYhMoDUaWNQ1QSicBjnATwIFCVPCE91VqhCPA== 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=aRNwt9E+1bJoLKKiUsRyKY7GIJyJUdLTEXyJaGny0OE=; b=ipNln5TauhxwJ0w0rnlzk2uM3jz9WALyJucJlNpRTizJcKUGJSEpmjwyuLLvzEOZqjLego4AsIo4uYUspGfdIYKpQFFuub49AKXF+yU9e9qLjlwnmMskaXu8K9uQAEFx5xDOOg522FkAmlvDY7XRL7ZQKu/ykMtuExowWq2hHI4= Received: from CY5P221CA0105.NAMP221.PROD.OUTLOOK.COM (2603:10b6:930:9::40) by DM4PR12MB5214.namprd12.prod.outlook.com (2603:10b6:5:395::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.21; Fri, 15 Sep 2023 22:42:42 +0000 Received: from CY4PEPF0000E9CD.namprd03.prod.outlook.com (2603:10b6:930:9:cafe::83) by CY5P221CA0105.outlook.office365.com (2603:10b6:930:9::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.21 via Frontend Transport; Fri, 15 Sep 2023 22:42:42 +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 CY4PEPF0000E9CD.mail.protection.outlook.com (10.167.241.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6792.20 via Frontend Transport; Fri, 15 Sep 2023 22:42:42 +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, 15 Sep 2023 17:42:40 -0500 From: Babu Moger To: , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v10 04/10] x86/resctrl: Add comments on RFTYPE flags hierarchy Date: Fri, 15 Sep 2023 17:42:21 -0500 Message-ID: <20230915224227.1336967-5-babu.moger@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230915224227.1336967-1-babu.moger@amd.com> References: <20230915224227.1336967-1-babu.moger@amd.com> MIME-Version: 1.0 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: CY4PEPF0000E9CD:EE_|DM4PR12MB5214:EE_ X-MS-Office365-Filtering-Correlation-Id: 05f52e28-0cd6-42d3-b6bd-08dbb63d127e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5+1x+qJ4WjVRAC/vZB7i7d2D3DfLMa8zEiN6+HratIK2nbQkdHzLG1Jz+C7qT7RnanJaF11Lh8NVFgj8Jv7UC8G84VQ/mmS49mlM4bNNWRQ1HJK5efq0Os8CU4GeGox3SnJ2SEv1SnNL5piB29z8Be3ckUiXKCTNe1QeoT3ko1c1rSd2Q8yAaegKfbuWGPVvpUV3DKSOMXe85mgF0S5SD4CXp5zF7cOx6OxUnHJlK7kQu1lTwt4lBDVwbMgnBCJlxxQLuG6IS6umFL4j78KvtuyFSGBoOS2pDO/TXNGk2gDIR72cwm5kLa+WHnLWZCL+kCKBul93nsk3zIS8cj4qmXGAE9yQuqPUX59Oms+KnN/ot1F8xMGmoJnG7kb02g7kzY0vTiF2IAzCES9YTuCt6iwhkfoW+8e9FVMoKzqD2JnWr4LcmkyAC+6f7z+m+TmkhjYVaaslNsOfIDAvFVj3qCFOscjR5fg5VPW48Ji1n/O9hrLMRDWRbYAyycZGnsW+gHYOiMIvtisFxIW2q9HD7iuHB7L1efiNhCB8YMmJJzxdV9faG+YL8+22s0eSWWgeynLpxSJlDJ3ktSOLORHEchvgiXCRY1AEpJRmuS4nji6QpizM7d0X/qY/zO+slKphiGMUjsz8zPaQS8w4+2Txl5Ea9mhMBrdttF8v91UDiHle6b14J/Nuy7A1QREC3nLEAOhjf4BCuheHC3d3BKQqWpgLokDHX59YX14dvT3lnJI9TobgzKbM9/EyNntIq5gmexKqHE3hZTLpoEyRrf439w== 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)(376002)(396003)(136003)(39860400002)(1800799009)(186009)(82310400011)(451199024)(46966006)(36840700001)(40470700004)(6666004)(478600001)(1076003)(2616005)(16526019)(26005)(356005)(40480700001)(81166007)(7696005)(40460700003)(82740400003)(86362001)(316002)(54906003)(110136005)(70206006)(70586007)(7416002)(7406005)(41300700001)(44832011)(2906002)(5660300002)(47076005)(8936002)(8676002)(4326008)(36756003)(36860700001)(426003)(336012)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2023 22:42:42.1674 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 05f52e28-0cd6-42d3-b6bd-08dbb63d127e 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: CY4PEPF0000E9CD.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5214 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 groat.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 (groat.vger.email [0.0.0.0]); Fri, 15 Sep 2023 15:45:15 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777145708436862739 X-GMAIL-MSGID: 1777145708436862739 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. Reviewed-by: Reinette Chatre Reviewed-by: Fenghua Yu Signed-off-by: Babu Moger Reviewed-by: Ilpo Järvinen --- arch/x86/kernel/cpu/resctrl/internal.h | 58 ++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index f71bc82c882f..14988c9f402c 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -240,6 +240,64 @@ struct rdtgroup { /* * 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.) + * + * Note: resctrl uses flags for files, not for directories. + * Directories are created based on the resource type. Added + * directories below for better understanding. + * + * 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 only for CTRL group) + * Files: mode, schemata, size + * */ #define RFTYPE_INFO BIT(0) #define RFTYPE_BASE BIT(1)