From patchwork Thu Mar 2 20:24:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 63560 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp55034wrd; Thu, 2 Mar 2023 12:29:44 -0800 (PST) X-Google-Smtp-Source: AK7set+p9Hf9KpwQT6jFCT66MjajR1FtjzZ7M91KvpGycfnJsqZ5mbrJYtRazq95A6sRag9BHpHM X-Received: by 2002:a05:6402:1643:b0:4a3:43c1:8431 with SMTP id s3-20020a056402164300b004a343c18431mr3296085edx.5.1677788984255; Thu, 02 Mar 2023 12:29:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677788984; cv=pass; d=google.com; s=arc-20160816; b=TjAP8WCMe6xyazu0qJNNJnfZRBFbu1rbv7+YT89Fx6gCBoWLyHcun3YfK5ZlgATtmA JU9aHvWwy6RKsXh5Gm2RHZ6EC5legoGxwpnQetTk4ePcujJ4wO3M0kg9V4Ojpuaxa96b eLJuwW0FNftZOcBNLXvUb/zTzWpK5aI/MEkbR6KrRCVdUbj1zJrEsN3auBo77vJLQhyv a+w56ULX4jlcyBkOLgveP84jhO8yH1xFOdLuCFPPNIltQJEvf5Q/aGUxYztxFaI5wy+E +VdQ2ATBUxqyo+5mgILEyiFs12+JOckeJui8FceCyw1Wnwtjgbnp1CyZTMazupWyTo0H edFA== 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 :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:dkim-signature; bh=CuBQ+BwcsjFgt2n25b4Jx3ABbjC1XMRl0btoiXYYkXU=; b=YWIfxTnUG06X5ok8r+4ToPwGB04mzi0v0MNUYRjmLo9WXK7zaOjnijHGzD1Hhe9WMz //TNFd+dyYf19YR28S+2DCSFnbon+imvXlidH/YQGxnPtqa+kh9yLr4K+hsYnJDZhQa0 tWehAY+PeFe4C3ZWC8/tLDq6c3IB1iJrtlgT1OcGIcyupaVk37f+6iUR88XqpzB1KGfi x3rMXOR1lPpLwnhCSUxqDV9t53a4TlRIws9ZyUYD2KlJh12/RN9AfK23i0EQWL9qfzhm nGZzwOubYCH0C0VifzDtrZnULvR/r0uizZv35pJj9mgLwWN7xircMWl9Kxpx4UFVJo9c Eytw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=4mpdd+8l; 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::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l6-20020aa7c3c6000000b004bf8bc671besi562595edr.408.2023.03.02.12.29.21; Thu, 02 Mar 2023 12:29:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=4mpdd+8l; 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::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229864AbjCBUZi (ORCPT + 99 others); Thu, 2 Mar 2023 15:25:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229941AbjCBUZO (ORCPT ); Thu, 2 Mar 2023 15:25:14 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2043.outbound.protection.outlook.com [40.107.237.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0379857D13; Thu, 2 Mar 2023 12:24:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MvxUI3rxv6n/I1a+cwdKuPCALUW14rjPAtR5cV0/lcPS3htso0LtEXadnUQhQOmG/sG3/pmlu4RDMYrGPo+YUX0qKuWH0BptBA7hfGcoWDpVj4/FbNdUWvo2KR8vVlsHMJuMAMVCQkVw32O23rABLZO8I6kj0f8xA7ZoLvaYnz+h3rasDMoaJVkroAspOHACO9AO+GSuHJsBjHR2lMLtbcfHeIq1uB+z0WCcu/ycR9Nokm6nA5NfGla0UVCQQ5c9oo/DkJ5ktY4po0ZgkZYveGNQXCWN7oUUk5yh+0xCmso2NOH9qU7qq8SUaRy84kbuPJfFQtz9UUL2u5556XB8rg== 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=CuBQ+BwcsjFgt2n25b4Jx3ABbjC1XMRl0btoiXYYkXU=; b=MKkfRY7nb2tSQbNswfLyoTES5IYNFulatEcULKbo2/SZ7HR0pnBWuLmDIiXUmk16tBTLMq1/a2JF4h3y4CpRqa66/aOZMxb9voH3VOBCU6/mqezP7YCpHAahzvvfDoDCpX10TDkG9BxqdJY0CRbx3YluGoqlETLeUevVuuG7XivkOUoRLrOCEMA4CAj/NInFzZ67WqSEAMoAVcNL2fYa7AQH4XhIxv8df3uAyuLpDdcxsBp1FRMAK5jCnQfNH5E99UZ3dQmjNIUYkfF7FrZeJoHUSoXeqbWkiZnIpkRP8kDnm48eovi8hsGTYkE1BjF66NaT6chYqy22EtguQSveSA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=quicinc.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 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=CuBQ+BwcsjFgt2n25b4Jx3ABbjC1XMRl0btoiXYYkXU=; b=4mpdd+8lDmAPMette5rUzv0alrtuX5GdT/jVUnC050xZbxxks7buw7dkGOcQdKCHZXIihElNsiekYXMyDsgEFLKJTdcrRowNzwWv3ahSNEg7KtpYDMuWBeeoYNrtKYY7IZh664jo5q9tPHalMrcl8JPXUk3HWVvU6vCQypqNQE8= Received: from DM6PR07CA0123.namprd07.prod.outlook.com (2603:10b6:5:330::24) by MN0PR12MB6127.namprd12.prod.outlook.com (2603:10b6:208:3c5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.18; Thu, 2 Mar 2023 20:24:50 +0000 Received: from DS1PEPF0000E632.namprd02.prod.outlook.com (2603:10b6:5:330:cafe::a2) by DM6PR07CA0123.outlook.office365.com (2603:10b6:5:330::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.19 via Frontend Transport; Thu, 2 Mar 2023 20:24:50 +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 DS1PEPF0000E632.mail.protection.outlook.com (10.167.17.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6156.12 via Frontend Transport; Thu, 2 Mar 2023 20:24:50 +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.34; Thu, 2 Mar 2023 14:24:47 -0600 Subject: [PATCH v3 4/7] x86/resctrl: Re-arrange RFTYPE flags based on hierarchy From: Babu Moger To: , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Date: Thu, 2 Mar 2023 14:24:46 -0600 Message-ID: <167778868692.1053859.13490646651097380957.stgit@bmoger-ubuntu> In-Reply-To: <167778850105.1053859.14596357862185564029.stgit@bmoger-ubuntu> References: <167778850105.1053859.14596357862185564029.stgit@bmoger-ubuntu> User-Agent: StGit/1.1.dev103+g5369f4c MIME-Version: 1.0 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: DS1PEPF0000E632:EE_|MN0PR12MB6127:EE_ X-MS-Office365-Filtering-Correlation-Id: 89e7a836-7679-473a-2921-08db1b5c2c86 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7F5p2xx3I9QPpF3flnYttoPVz/nmCnuB8yqrR1ndUPdm8AuqUquuw6CGoRUf8D0pWkZeXb5DF3mo1/CiEwFz1Sa/XZNKgnLKyv0rGKgYiPiy7ooFioPUKjcd4pUdt8yS4G4mwpQhkt55s5ZHP3/hqozmhe6ukwX/AHzFCRlvjGjG8WF5Jcb1kwoPr5wIvMfAwDMoxmYLVpF/IRAO4KoMlsTv/6zAi2InhQogacgR0m5U4LeOkyLmV4aOsiDpLGwC+Nu91YCZb86qt0DGGk/CyGVBLGmrxejMgzgzRE7Ws757X+rRmNfGGty7FloRU/GaMcA4WRB3bhC4HTBA53IqezamOeU8zIfdi21P/AdYjiW1pcjUTjzuU7yoFpgC0Sfp9byyAZGmsYUzSQAhBJIoywS09iTkd6Vmdg8sR7nmX9atib4UajBjMbz216PutaYd7RDw5smu7jWVO+1FjcwMiQT449/xbMsvycdkJ2I9B/8fmyGtnCpPCTw7WolJdvi1946C36OZwyM0+067v5JuwLmah8f5IVN6BGrGOxFnM3gYWbmPzHgzb+q54JWH6eI+RVMmWUZH7ZV79/kSnqYcQjjfBPIQRnbJEWWsAbp8Cbfo7I3EuBShuqrCisnfr8LQD1t7dKXMhSodkUCuqzsihCOt847oqGHYnEBNQDMTUSik51U7MGycadUX0Q9we0T0H7j3dRDkQ0S5AFlTeQNC+sWEPGSW7ONdk+4hd9bNM6Mgcuyy5yOAADUT4P/JXdpGY+xtveRli64P9ai6w7rTGw== 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:(13230025)(4636009)(7916004)(39860400002)(376002)(396003)(136003)(346002)(451199018)(36840700001)(40470700004)(46966006)(83380400001)(36860700001)(47076005)(426003)(40460700003)(33716001)(356005)(5660300002)(8936002)(81166007)(478600001)(7416002)(82740400003)(7406005)(86362001)(40480700001)(103116003)(82310400005)(9686003)(16526019)(186003)(26005)(336012)(44832011)(2906002)(8676002)(4326008)(70586007)(70206006)(41300700001)(54906003)(16576012)(110136005)(316002)(71626013)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2023 20:24:50.0206 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 89e7a836-7679-473a-2921-08db1b5c2c86 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: DS1PEPF0000E632.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6127 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759289261847549155?= X-GMAIL-MSGID: =?utf-8?q?1759289261847549155?= RESCTRL filesystem has two main components: a. info (Details on resources and monitoring) b. base (Details on CONTROL and MON groups) The rftype flags can be renamed accordingly for better understanding. For example: RFTYPE_INFO : Files with these flags go in info directory RFTYPE_INFO_MON : Files with these flags go in info/L3_MON RFTYPE_BASE : Files with these flags go in group's(control or mon) base directory RFTYPE_BASE_CTRL: Files with these flags go in only CONTROL groups Add comments to make it easy for future additions. Signed-off-by: Babu Moger --- arch/x86/kernel/cpu/resctrl/core.c | 8 ++-- arch/x86/kernel/cpu/resctrl/internal.h | 64 ++++++++++++++++++++++++++++---- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 44 +++++++++++----------- 3 files changed, 81 insertions(+), 35 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c index 030d3b409768..d1c6b2cc8611 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -69,7 +69,7 @@ struct rdt_hw_resource rdt_resources_all[] = { .domains = domain_init(RDT_RESOURCE_L3), .parse_ctrlval = parse_cbm, .format_str = "%d=%0*x", - .fflags = RFTYPE_RES_CACHE, + .fflags = RFTYPE_CACHE, }, .msr_base = MSR_IA32_L3_CBM_BASE, .msr_update = cat_wrmsr, @@ -83,7 +83,7 @@ struct rdt_hw_resource rdt_resources_all[] = { .domains = domain_init(RDT_RESOURCE_L2), .parse_ctrlval = parse_cbm, .format_str = "%d=%0*x", - .fflags = RFTYPE_RES_CACHE, + .fflags = RFTYPE_CACHE, }, .msr_base = MSR_IA32_L2_CBM_BASE, .msr_update = cat_wrmsr, @@ -97,7 +97,7 @@ struct rdt_hw_resource rdt_resources_all[] = { .domains = domain_init(RDT_RESOURCE_MBA), .parse_ctrlval = parse_bw, .format_str = "%d=%*u", - .fflags = RFTYPE_RES_MB, + .fflags = RFTYPE_MB, }, }, [RDT_RESOURCE_SMBA] = @@ -109,7 +109,7 @@ struct rdt_hw_resource rdt_resources_all[] = { .domains = domain_init(RDT_RESOURCE_SMBA), .parse_ctrlval = parse_bw, .format_str = "%d=%*u", - .fflags = RFTYPE_RES_MB, + .fflags = RFTYPE_MB, }, }, }; diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index 2cfc3c431d5b..6767c85b9699 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -240,18 +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 (Displays information about control and monitoring) + * | + * --> base (Displays the details on resctrl groups) + * + * ------------------------------------------------------------- + * info directory structure + * --> INFO + * --> TOP + * last_cmd_status + * + * --> MON + * --> (L2_MON) + * --> (L3_MON) + * max_threshold_occupancy, mbm_local_bytes_config, + * mbm_total_bytes_config, mon_features, num_rmids + * + * --> RES + * --> CACHE (L2, L3) + * bit_usage, cbm_mask, min_cbm_bits, num_closids, + * shareable_bits + * + * --> MB (MB, SMBA) + * bandwidth_gran, delay_linear, min_bandwidth, + * num_closids + * + * group structure + * ----------------------------------------------------------- + * --> BASE (Files common for both MON and CTRL groups) + * cpus, cpus_list, tasks + * + * --> CTRL (Files only for CTRL group) + * mode, schemata, size + * */ #define RFTYPE_INFO BIT(0) #define RFTYPE_BASE BIT(1) -#define RFTYPE_CTRL BIT(4) -#define RFTYPE_MON BIT(5) -#define RFTYPE_TOP BIT(6) -#define RFTYPE_RES_CACHE BIT(8) -#define RFTYPE_RES_MB BIT(9) -#define RFTYPE_CTRL_INFO (RFTYPE_INFO | RFTYPE_CTRL) -#define RFTYPE_MON_INFO (RFTYPE_INFO | RFTYPE_MON) -#define RFTYPE_TOP_INFO (RFTYPE_INFO | RFTYPE_TOP) -#define RFTYPE_CTRL_BASE (RFTYPE_BASE | RFTYPE_CTRL) + +#define RFTYPE_TOP BIT(2) +#define RFTYPE_MON BIT(3) +#define RFTYPE_RES BIT(4) + +#define RFTYPE_CACHE BIT(5) +#define RFTYPE_MB BIT(6) + +#define RFTYPE_CTRL BIT(8) + +#define RFTYPE_INFO_TOP (RFTYPE_INFO | RFTYPE_TOP) +#define RFTYPE_INFO_MON (RFTYPE_INFO | RFTYPE_MON) +#define RFTYPE_INFO_RES (RFTYPE_INFO | RFTYPE_RES) + +#define RFTYPE_BASE_CTRL (RFTYPE_BASE | RFTYPE_CTRL) /* List of all resource groups */ extern struct list_head rdt_all_groups; diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index fc7d1e778bff..1eb538965bd3 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -1691,77 +1691,77 @@ static struct rftype res_common_files[] = { .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_last_cmd_status_show, - .fflags = RFTYPE_TOP_INFO, + .fflags = RFTYPE_INFO_TOP, }, { .name = "num_closids", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_num_closids_show, - .fflags = RFTYPE_CTRL_INFO, + .fflags = RFTYPE_INFO_RES, }, { .name = "mon_features", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_mon_features_show, - .fflags = RFTYPE_MON_INFO, + .fflags = RFTYPE_INFO_MON, }, { .name = "num_rmids", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_num_rmids_show, - .fflags = RFTYPE_MON_INFO, + .fflags = RFTYPE_INFO_MON, }, { .name = "cbm_mask", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_default_ctrl_show, - .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_CACHE, + .fflags = RFTYPE_INFO_RES | RFTYPE_CACHE, }, { .name = "min_cbm_bits", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_min_cbm_bits_show, - .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_CACHE, + .fflags = RFTYPE_INFO_RES | RFTYPE_CACHE, }, { .name = "shareable_bits", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_shareable_bits_show, - .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_CACHE, + .fflags = RFTYPE_INFO_RES | RFTYPE_CACHE, }, { .name = "bit_usage", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_bit_usage_show, - .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_CACHE, + .fflags = RFTYPE_INFO_RES | RFTYPE_CACHE, }, { .name = "min_bandwidth", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_min_bw_show, - .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_MB, + .fflags = RFTYPE_INFO_RES | RFTYPE_MB, }, { .name = "bandwidth_gran", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_bw_gran_show, - .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_MB, + .fflags = RFTYPE_INFO_RES | RFTYPE_MB, }, { .name = "delay_linear", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdt_delay_linear_show, - .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_MB, + .fflags = RFTYPE_INFO_RES | RFTYPE_MB, }, /* * Platform specific which (if any) capabilities are provided by @@ -1780,7 +1780,7 @@ static struct rftype res_common_files[] = { .kf_ops = &rdtgroup_kf_single_ops, .write = max_threshold_occ_write, .seq_show = max_threshold_occ_show, - .fflags = RFTYPE_MON_INFO | RFTYPE_RES_CACHE, + .fflags = RFTYPE_INFO_MON | RFTYPE_CACHE, }, { .name = "mbm_total_bytes_config", @@ -1827,7 +1827,7 @@ static struct rftype res_common_files[] = { .kf_ops = &rdtgroup_kf_single_ops, .write = rdtgroup_schemata_write, .seq_show = rdtgroup_schemata_show, - .fflags = RFTYPE_CTRL_BASE, + .fflags = RFTYPE_BASE_CTRL, }, { .name = "mode", @@ -1835,14 +1835,14 @@ static struct rftype res_common_files[] = { .kf_ops = &rdtgroup_kf_single_ops, .write = rdtgroup_mode_write, .seq_show = rdtgroup_mode_show, - .fflags = RFTYPE_CTRL_BASE, + .fflags = RFTYPE_BASE_CTRL, }, { .name = "size", .mode = 0444, .kf_ops = &rdtgroup_kf_single_ops, .seq_show = rdtgroup_size_show, - .fflags = RFTYPE_CTRL_BASE, + .fflags = RFTYPE_BASE_CTRL, }, }; @@ -1899,7 +1899,7 @@ void __init thread_throttle_mode_init(void) if (!rft) return; - rft->fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_MB; + rft->fflags = RFTYPE_INFO_RES | RFTYPE_MB; } void __init mbm_config_rftype_init(const char *config) @@ -1908,7 +1908,7 @@ void __init mbm_config_rftype_init(const char *config) rft = rdtgroup_get_rftype_by_name(config); if (rft) - rft->fflags = RFTYPE_MON_INFO | RFTYPE_RES_CACHE; + rft->fflags = RFTYPE_INFO_MON | RFTYPE_CACHE; } /** @@ -2043,21 +2043,21 @@ static int rdtgroup_create_info_dir(struct kernfs_node *parent_kn) if (IS_ERR(kn_info)) return PTR_ERR(kn_info); - ret = rdtgroup_add_files(kn_info, RFTYPE_TOP_INFO); + ret = rdtgroup_add_files(kn_info, RFTYPE_INFO_TOP); if (ret) goto out_destroy; /* loop over enabled controls, these are all alloc_capable */ list_for_each_entry(s, &resctrl_schema_all, list) { r = s->res; - fflags = r->fflags | RFTYPE_CTRL_INFO; + fflags = r->fflags | RFTYPE_INFO_RES; ret = rdtgroup_mkdir_info_resdir(s, s->name, fflags); if (ret) goto out_destroy; } for_each_mon_capable_rdt_resource(r) { - fflags = r->fflags | RFTYPE_MON_INFO; + fflags = r->fflags | RFTYPE_INFO_MON; sprintf(name, "%s_MON", r->name); ret = rdtgroup_mkdir_info_resdir(r, name, fflags); if (ret) @@ -3218,7 +3218,7 @@ static int mkdir_rdt_prepare(struct kernfs_node *parent_kn, if (rtype == RDTCTRL_GROUP) fflags = RFTYPE_BASE | RFTYPE_CTRL; else - fflags = RFTYPE_BASE | RFTYPE_MON; + fflags = RFTYPE_BASE; ret = rdtgroup_add_files(kn, fflags); if (ret) { @@ -3554,7 +3554,7 @@ static int __init rdtgroup_setup_root(void) list_add(&rdtgroup_default.rdtgroup_list, &rdt_all_groups); - ret = rdtgroup_add_files(kernfs_root_to_node(rdt_root), RFTYPE_CTRL_BASE); + ret = rdtgroup_add_files(kernfs_root_to_node(rdt_root), RFTYPE_BASE_CTRL); if (ret) { kernfs_destroy_root(rdt_root); goto out;