From patchwork Thu Feb 2 21:47:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 52175 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp491091wrn; Thu, 2 Feb 2023 13:50:45 -0800 (PST) X-Google-Smtp-Source: AK7set8/aWAZJJxyLSi70mh6D4x5jRj7JqpBr1ggUJVEQ5nkNtjwVOKZQjF6OYyZdNzTGM3atH5d X-Received: by 2002:a17:907:c282:b0:7bd:43e9:d3ab with SMTP id tk2-20020a170907c28200b007bd43e9d3abmr7213135ejc.52.1675374645451; Thu, 02 Feb 2023 13:50:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675374645; cv=pass; d=google.com; s=arc-20160816; b=og2VjpAMtU/yL0E4n1Owzw6ur3oQxbTtgLowcUXDRe8jm0s8LO2V8qo64JXvTf2Hxl SkE7Abw4GoVHcoAXJ5VyitviSeu/W+74/Uyn8FdkVtghjcBJu+8JJNZB05a3vbpymdrn car7BE63gXDZIRb50QU6nAdBqbWiH4JClIKJ7LwEFGsgw6BTINcnwf1MWJgiarJt3AAD cjRLt6TXkgZuuDRb5bCft8pfac+CHxv6vPQXx/Nh21jAHeJ2Wqr6gJ0s+g+VYj8s9Emp fty5QfdJ8Q30TT1j5vJvoDfGoy0ik9cEzteoOWkLLLGZrKuPtsHSaYnNq71adkOL33yb Q2RQ== 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=bnAN7k5e6XsUD4VWgunnxWbcjaSIjDkBs/wXuwv16Tg=; b=JiU20ilQn+RuRze4bDCmV/Gr8rtXFm0u1jn/EmFHts3CBerm+P+b6Z94lCTgI1VaGb zurznMRt0mNabgNzM3zoEbf6+fDdrC6jZ3G6chTTYSYniXOQ+x1rz3ywUmWLVbaI+eSI p6u4PWRgX/C8HBb3m0tG3OO9qrMfQC4nifgaMCOyb/mR4baRBzd3W+87HJX64KjZO3mu TZc/Sijy/dZvAK/zzK5JGbkfUPVcZZ5U1aTSfSd854URzZSY0uROKm73h/vxcyj/5OKK 1TEe1V5QBdTpfldM9bYOgyTzABeflXyWOG1camjMOo91meS8nNElVo2Dad3j+T1Kgho8 5+Ow== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="x7GXY/hJ"; 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 fd20-20020a1709072a1400b0087f0d8253d3si682849ejc.543.2023.02.02.13.50.21; Thu, 02 Feb 2023 13:50:45 -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="x7GXY/hJ"; 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 S231339AbjBBVro (ORCPT + 99 others); Thu, 2 Feb 2023 16:47:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233046AbjBBVrk (ORCPT ); Thu, 2 Feb 2023 16:47:40 -0500 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2068.outbound.protection.outlook.com [40.107.101.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5097686255; Thu, 2 Feb 2023 13:47:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mncR11tgbfKFNANlf+TVIgr7WmgBdr2BKbJVa0lMrpNktfyNCkQ3d2zF95spYPx9cHUtc4vAOHbfqK91/tTkG1TQe8YCscokahbTA3xBcoSTyywV8miyynsodpL9IKd1SUh2DVQ4NDcMRn0R3X2oH+KGmeCwy4gxcmaRIWRf8jFfNQ+DgOpbdvsyZauQXnsBI99CeEnrpLfvaIxCmhGyVp8vYbBgA1FWyGB34B6sJAZlW2Z/eOKRQNjy3FPI5gncj793AQjYzaMaDsXXmE/dBnJvh1nuFaNMDcECao48/gBmA1DonBFUdzjjN+tHDkWeWMxDzd7g7MYTSebNBmsEYw== 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=bnAN7k5e6XsUD4VWgunnxWbcjaSIjDkBs/wXuwv16Tg=; b=jNwwj41I3rMFrYuulGI9PWQj4n0ileSICUsmalDcvbR+KHv8PVDYExrWQYpqinRYYAj4cAu2ethDI80a335pPO7ha7frBFFEkHy7FrmkViIN1rCZBgiyXBo7sgvGLkj/G61W7RXJX0zhaDEfw4BZ2n4GlAOExnPM76Xd4S5WwVaOkgbVr8jRkHuzLq3DguzhW65A+uZTLDyryc8jxSYnPo9n0xgy2fx+59yfxX7er5hZepl0huXFdi6K8oaL04grgMlSC5byyHiOKWAlJOZ0piU3kyhJOUUU40SPacEcg+eV0lHIJVbm2LfwDP+u+9qAGQMHlIcDbpDQG7lneHdBMA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=zytor.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=bnAN7k5e6XsUD4VWgunnxWbcjaSIjDkBs/wXuwv16Tg=; b=x7GXY/hJx58jFEC3+yq+hcRLXRPpdhzvxt/C6vVrL3+/xrbwMzlWHe3EIK2XXrWUMPpuGPYMoiounMQC/4/04bRIkwua6sFJRh5GiMUifSPiPnKAhpP7ufNo5WKvRbfmWtgWdT8L3SrW1lITi/xTlkLC9UhGSJRledHcjDx75TQ= Received: from BY5PR16CA0013.namprd16.prod.outlook.com (2603:10b6:a03:1a0::26) by MW4PR12MB7484.namprd12.prod.outlook.com (2603:10b6:303:212::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.27; Thu, 2 Feb 2023 21:47:21 +0000 Received: from CO1PEPF00001A5E.namprd05.prod.outlook.com (2603:10b6:a03:1a0:cafe::88) by BY5PR16CA0013.outlook.office365.com (2603:10b6:a03:1a0::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.25 via Frontend Transport; Thu, 2 Feb 2023 21:47:20 +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 CO1PEPF00001A5E.mail.protection.outlook.com (10.167.241.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.17 via Frontend Transport; Thu, 2 Feb 2023 21:47:20 +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 Feb 2023 15:47:19 -0600 Subject: [RFC v2 PATCH 4/7] x86/resctrl: Re-arrange RFTYPE flags based on hierarchy From: Babu Moger To: , CC: , , , , , , , , , , , Date: Thu, 2 Feb 2023 15:47:18 -0600 Message-ID: <167537443852.647488.1158619967633364811.stgit@bmoger-ubuntu> In-Reply-To: <167537433143.647488.9641864719195184123.stgit@bmoger-ubuntu> References: <167537433143.647488.9641864719195184123.stgit@bmoger-ubuntu> User-Agent: StGit/1.1.dev103+g5369f4c 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: CO1PEPF00001A5E:EE_|MW4PR12MB7484:EE_ X-MS-Office365-Filtering-Correlation-Id: bfaeb5af-5729-4522-1f5d-08db05670fc9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vecUbxAoJeBL57azhKk4h5NvhSyizgIBjOBR9GvLqot6tEhmUpmzFq6mFkP3WpuORJHntHFV3FrlWxeDsFQY6BN9SqZiCE+bGzOR++HUcwfawS8Lu0hqtF6z5WN9WhHiid+HQkY3SQ3hgC/rkN8gVkgYcDdTvDGeb3DzhZyXpsNDin2X1n/9PO9IIk4oRx1LqKeKDwGCdgBn0KRgh6uwB5S+mRDJlqNM92B0lTc2jsE94N8vpWyAj5T2zLSx0NF5XOVFW2MlC+BQJk7engQh/hDjhTc6PvoYnFEFEqmAP04ljVkD8Ga6GvF6uv3epnXb/yvE60N/I5DH820+lffmVkWBeA+1lE/oalC/xq4TgmdmAAgvUf5GYA+zlHE630RJe30StM62gOnm+63CHBpjDfZDCbriAJoTiHPSoK17BbrbmmyPofYlv03727vPUC+Av7PnT7nZR/K7mKtpa30Um95URe+tvpWT/gaX5EktzFAYMkWE7/K8ny8qrBrFk6lfpOz9ToTb6tgzmSdF6TEDturAA5tVICUQMrdhorcYo/zk6TcNiqiSWabt0iznsfBUNHf2ex6FYKXTvm9rtzZSYbob2cndEnRAPng/WmA5LdJI6hNIprDeGZRUkM2kGN00uEEQrlJSMDN02ESqQgUXJqU0JX4WTY0nTcausDWu6Pes/7A6nQxIkMLVaG12pqWui01bddiZDb+KcmlZ8nmkUeM6ImdpIvoi4WDP9XudfpEoMUgcgleGhWkbHlwuTHJ25/ow5CU+yA3ECUWySHlxQQ== 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)(376002)(39860400002)(346002)(396003)(136003)(451199018)(40470700004)(46966006)(36840700001)(82740400003)(426003)(44832011)(40460700003)(8936002)(478600001)(336012)(83380400001)(33716001)(186003)(26005)(103116003)(16526019)(70586007)(110136005)(4326008)(7416002)(316002)(41300700001)(16576012)(8676002)(70206006)(2906002)(5660300002)(9686003)(54906003)(86362001)(40480700001)(47076005)(82310400005)(36860700001)(356005)(81166007)(71626013)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 21:47:20.6103 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bfaeb5af-5729-4522-1f5d-08db05670fc9 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: CO1PEPF00001A5E.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7484 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?1756757644029549627?= X-GMAIL-MSGID: =?utf-8?q?1756757644029549627?= 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 | 42 +++++++++++---------- 3 files changed, 80 insertions(+), 34 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 018a26b58154..18d458a3cba6 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) @@ -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;