From patchwork Thu Dec 1 15:36:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 28435 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp329901wrr; Thu, 1 Dec 2022 07:38:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf7ZllSzUq8Nq46pnlge+rnXY7Bjq6KTLVPQpUERAyXFk171NZABAGWQII046Pzbz+H1bOQR X-Received: by 2002:a05:6a00:2181:b0:574:5c9e:c1f2 with SMTP id h1-20020a056a00218100b005745c9ec1f2mr41930604pfi.52.1669909081668; Thu, 01 Dec 2022 07:38:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1669909081; cv=pass; d=google.com; s=arc-20160816; b=uc+7Zj+goBXB2+l8+sBGlV+AM6I+0KmaFzZk7G3U28kVJW8AeB8Sx3aX0kulyqs4Ua OLMgjczrhSuBNWWYLbO6eJo+qsG8PdHXXPMCBamt8uc9Y6JgQCQ91trUCs/EGoq5YQ5K pmuqkexPTbgEusdCl0AyUF8dnUWK3D5stD4xDzo9Q1j04Fimu7V7CCtZpJWI3eYCKd90 xWl4u4UUJY/vCShWvrcdRWYMOwoKf+JcMy34TSaetRRMHltND/5Ssn97KzDrtIJAbYAM yBd96cYGsZ6ZCqoqfCxjHZ/o2bQWTlFG3OtTSevut2Mcb6sqcs6rVEh+7t7YHSz3D0G2 AjGw== 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=NiG/9RARrO/kQegglLrfX8Om4FftYr91k2tO+rZZ6NA=; b=MeSo2BtJpA3Qh22hWOH+UKw8Q0pMKbJmdLwo/48HudlCTGTut82/0Zi07jPUiaBkpW hASXQ80AaAo6WHMQmAHv6VXahT3jMvWcegTXADNa9ugmxDwFl67yOLkD7YeRTqBzvU2n fc/pn1LNb+kgqeViMqWISgf/Qsxhc3aoVKh8OGCitBJO0ze5jTVeTkbCsnvU2X4DdtjC vppUkpNauD1+y4xqBo09XQLdBHEio1QSwOixLNyTP/irx0qS1A+a5HJSB1t7OSB/tElf P/jOJ8dEN3BiO0cYDNwjGfnFM+LPcMKIejzsucuS9R6yXxH+jRGBTtknzkQprvv3KM9Y 6IIQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=iwdUnEsf; 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 v13-20020a17090a4ecd00b00212f7abe85csi7346215pjl.41.2022.12.01.07.37.48; Thu, 01 Dec 2022 07:38:01 -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=iwdUnEsf; 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 S232057AbiLAPh1 (ORCPT + 99 others); Thu, 1 Dec 2022 10:37:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232190AbiLAPhI (ORCPT ); Thu, 1 Dec 2022 10:37:08 -0500 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2054.outbound.protection.outlook.com [40.107.223.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20AF1AE4E2; Thu, 1 Dec 2022 07:37:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bwM6epcZk7f1RyCbYJ8BNidLtUi908/E5t9tHw/cFO5YI94ly4TKVm4+gCnbhis42kkbaNK2FGLMY+ROXJM9d/+4CwLOBsXy75fFLQFoq5k48M8DYYCVTa4fUfF7avknHOxc70RXFGgEu8FQN6QauxuuW1NDnPz9uM2HAcreel0Z6Xcm+f1BkiQLQfNDEK7lTYuBmA3hMaRn+xfqCCB8m1YTNXNDC/d60MeVMBb29Np1S1m1ADYxK/QDfCVnD/EindYajHj5yr8hhuRab4Krm4jRAu4mNgfSHURh/YP71VnlLeZyc89NbMG3S+o7z64r3XY5PRWgF1u+qLaUO2NQjg== 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=NiG/9RARrO/kQegglLrfX8Om4FftYr91k2tO+rZZ6NA=; b=jWY5iDnBw4Y0NsbIop7Kmvs4WR0BNwiUHpGo0KthtdoQSTg4ia3HLB/0dUVV9fwoL9hhjJ9yHRFtjkuDcYn+okI9PhtauMpUEZaWBBrGxSiX7fZcLtzG1LGE75BNFWx2TY2wljFjR9+md4ZM7xICb2Gam0BEZGL6mpMw/+2pjY0jtnm7VJlu33MreoBz5RD7F6H7a0QJwD3Y83WRy/7YoB9gJEa9l0AV57hUsiwhtMm5jqWN6hTtz++XZ/obXkfEWDP5B+ztCFazf/25qCbZOItV5O5WbOM61uZOpqk55DdELAV0sY5AuN7C/VaLztsuxdrTbpaU5OJfSUSMmz/Jig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linutronix.de 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=NiG/9RARrO/kQegglLrfX8Om4FftYr91k2tO+rZZ6NA=; b=iwdUnEsf4tRcnyEYWxHmikckmElFqHEpNZfjVZzVkHqP532slJFLuN8igLX6Y1aaPlqbJvzrqxPekY0OLALg67G28TCJlLSjrQuj8EGJzW5aEx8M2vwlvwLBNJsgTPIEZLJEgcNCiKj/Dio5kpFg+Ptq8E0Pf5GHBf5Inj069XE= Received: from MW4PR03CA0031.namprd03.prod.outlook.com (2603:10b6:303:8e::6) by MN2PR12MB4357.namprd12.prod.outlook.com (2603:10b6:208:262::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.8; Thu, 1 Dec 2022 15:37:04 +0000 Received: from CO1NAM11FT023.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8e:cafe::28) by MW4PR03CA0031.outlook.office365.com (2603:10b6:303:8e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.25 via Frontend Transport; Thu, 1 Dec 2022 15:37:04 +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 CO1NAM11FT023.mail.protection.outlook.com (10.13.175.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5834.8 via Frontend Transport; Thu, 1 Dec 2022 15:37:03 +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, 1 Dec 2022 09:36:56 -0600 Subject: [PATCH v9 08/13] x86/resctrl: Add sysfs interface to read mbm_total_bytes_config From: Babu Moger To: , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Date: Thu, 1 Dec 2022 09:36:55 -0600 Message-ID: <166990901578.17806.14559688057407662110.stgit@bmoger-ubuntu> In-Reply-To: <166990882621.17806.16780480657453071426.stgit@bmoger-ubuntu> References: <166990882621.17806.16780480657453071426.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: CO1NAM11FT023:EE_|MN2PR12MB4357:EE_ X-MS-Office365-Filtering-Correlation-Id: ca28995d-45b0-43b7-18e0-08dad3b1e59e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P0PmAK1EZmeMDgYGHMEA/3NCO19nwiOZvtjWiOoZbRQ1a1LJ8LnbE5h22AVPUo8jCIbOIV+UQyjiGoBKn1Wghu5YT/cVHRIwLzL71CRWJ96Sc+zExvqhYcYk6CKAUEVmRIB8EvQjR/re/Hq85mG5+R6vKI7cX1JogI2fSj6+LolxcFsNFAxQIaS3rCQBlX112LEHCYC9Ul0rC3qTF5FTwnjrPERXtR2Uau42JzU47aHuXpHDwivNVv4UOABv5lLQ2t5HzOusU7tYbbmVSF8KPmsBS18dSOe7+N4LREf9DAg7JVBR9MKUYURbHg50HlP7PzuLgdQXtSVp/KXDyjYPvrjqpgjQJSxGuqz8DKK1jFq0dr66L/bd6wzexRmQn7LPFT62bi8wCpOfxJXwhx0S3lQbBjdbxbwU5A708qNTya6AwkQHdO8fx7a+gFTbTAe+HtO8wpZEfXa5RA2MUlQQdiEDUZU66iAipQ+bdsEE/4MwQSH+X+/j17PVDDu8wR/qi5qVBV3cV716bdYjCIQRdjFJBrPHfZG+5Z7ZCtI0ctnGi7vP9du3k56tCUNjelVfEEZywoWUfj1bzLFCfFUwY/g8i/d0gvuSPuj3XFAsYBQtwqlQB6fqr5omhVnMx9ciEJFxvQLiHhKpNnKLylrEvdBnA2Kh6f5ZFuFX6Em6oT39ko4EUBEuXRUuDpJka1or+gmd+C6Hu/Qjn4IjAaDh8kl5qp+u/aJZWh0VXHLfEd00aHtFNW24UUOfN1Jws0U5 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:(13230022)(4636009)(7916004)(346002)(39860400002)(396003)(136003)(376002)(451199015)(46966006)(36840700001)(40470700004)(16526019)(336012)(40460700003)(103116003)(54906003)(316002)(16576012)(110136005)(40480700001)(81166007)(356005)(86362001)(82740400003)(83380400001)(426003)(82310400005)(26005)(47076005)(186003)(9686003)(2906002)(5660300002)(7406005)(44832011)(36860700001)(33716001)(478600001)(8936002)(70206006)(70586007)(8676002)(4326008)(7416002)(41300700001)(71626007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2022 15:37:03.9643 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ca28995d-45b0-43b7-18e0-08dad3b1e59e 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: CO1NAM11FT023.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4357 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham 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?1751026585400046559?= X-GMAIL-MSGID: =?utf-8?q?1751026585400046559?= The current event configuration can be viewed by the user by reading the configuration file /sys/fs/resctrl/info/L3_MON/mbm_total_bytes_config. The event configuration settings are domain specific and will affect all the CPUs in the domain. Following are the types of events supported: ==== =========================================================== Bits Description ==== =========================================================== 6 Dirty Victims from the QOS domain to all types of memory 5 Reads to slow memory in the non-local NUMA domain 4 Reads to slow memory in the local NUMA domain 3 Non-temporal writes to non-local NUMA domain 2 Non-temporal writes to local NUMA domain 1 Reads to memory in the non-local NUMA domain 0 Reads to memory in the local NUMA domain ==== =========================================================== By default, the mbm_total_bytes_config is set to 0x7f to count all the event types. For example: $cat /sys/fs/resctrl/info/L3_MON/mbm_total_bytes_config 0=0x7f;1=0x7f;2=0x7f;3=0x7f In this case, the event mbm_total_bytes is currently configured with 0x7f on domains 0 to 3. Signed-off-by: Babu Moger --- arch/x86/include/asm/msr-index.h | 1 arch/x86/kernel/cpu/resctrl/internal.h | 24 ++++++++ arch/x86/kernel/cpu/resctrl/monitor.c | 4 + arch/x86/kernel/cpu/resctrl/rdtgroup.c | 99 ++++++++++++++++++++++++++++++++ 4 files changed, 127 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index e0a40027aa62..2e5f57c93605 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -1062,6 +1062,7 @@ /* - AMD: */ #define MSR_IA32_MBA_BW_BASE 0xc0000200 #define MSR_IA32_SMBA_BW_BASE 0xc0000280 +#define MSR_IA32_EVT_CFG_BASE 0xc0000400 /* MSR_IA32_VMX_MISC bits */ #define MSR_IA32_VMX_MISC_INTEL_PT (1ULL << 14) diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index b36750334deb..f7fc69e82e8b 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -30,6 +30,29 @@ */ #define MBM_CNTR_WIDTH_OFFSET_MAX (62 - MBM_CNTR_WIDTH_BASE) +/* Reads to Local DRAM Memory */ +#define READS_TO_LOCAL_MEM BIT(0) + +/* Reads to Remote DRAM Memory */ +#define READS_TO_REMOTE_MEM BIT(1) + +/* Non-Temporal Writes to Local Memory */ +#define NON_TEMP_WRITE_TO_LOCAL_MEM BIT(2) + +/* Non-Temporal Writes to Remote Memory */ +#define NON_TEMP_WRITE_TO_REMOTE_MEM BIT(3) + +/* Reads to Local Memory the system identifies as "Slow Memory" */ +#define READS_TO_LOCAL_S_MEM BIT(4) + +/* Reads to Remote Memory the system identifies as "Slow Memory" */ +#define READS_TO_REMOTE_S_MEM BIT(5) + +/* Dirty Victims to All Types of Memory */ +#define DIRTY_VICTIMS_TO_ALL_MEM BIT(6) + +/* Max event bits supported */ +#define MAX_EVT_CONFIG_BITS GENMASK(6, 0) struct rdt_fs_context { struct kernfs_fs_context kfc; @@ -531,5 +554,6 @@ bool has_busy_rmid(struct rdt_resource *r, struct rdt_domain *d); void __check_limbo(struct rdt_domain *d, bool force_free); void rdt_domain_reconfigure_cdp(struct rdt_resource *r); void __init thread_throttle_mode_init(void); +void __init mbm_config_rftype_init(const char *config); #endif /* _ASM_X86_RESCTRL_INTERNAL_H */ diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/resctrl/monitor.c index b39e0eca1879..2afddebc8636 100644 --- a/arch/x86/kernel/cpu/resctrl/monitor.c +++ b/arch/x86/kernel/cpu/resctrl/monitor.c @@ -784,8 +784,10 @@ int __init rdt_get_mon_l3_config(struct rdt_resource *r) return ret; if (rdt_cpu_has(X86_FEATURE_BMEC)) { - if (rdt_cpu_has(X86_FEATURE_CQM_MBM_TOTAL)) + if (rdt_cpu_has(X86_FEATURE_CQM_MBM_TOTAL)) { mbm_total_event.configurable = true; + mbm_config_rftype_init("mbm_total_bytes_config"); + } if (rdt_cpu_has(X86_FEATURE_CQM_MBM_LOCAL)) mbm_local_event.configurable = true; } diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 8342feb54a7f..e93b1c206116 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -1423,6 +1423,90 @@ static int rdtgroup_size_show(struct kernfs_open_file *of, return ret; } +struct mon_config_info { + u32 evtid; + u32 mon_config; +}; + +#define INVALID_CONFIG_INDEX UINT_MAX + +/** + * mon_event_config_index_get - get the index for the configurable event + * @evtid: event id. + * + * Return: 0 for evtid == QOS_L3_MBM_TOTAL_EVENT_ID + * 1 for evtid == QOS_L3_MBM_LOCAL_EVENT_ID + * INVALID_CONFIG_INDEX for invalid evtid + */ +static inline unsigned int mon_event_config_index_get(u32 evtid) +{ + switch (evtid) { + case QOS_L3_MBM_TOTAL_EVENT_ID: + return 0; + case QOS_L3_MBM_LOCAL_EVENT_ID: + return 1; + default: + /* WARN */ + return INVALID_CONFIG_INDEX; + } +} + +static void mon_event_config_read(void *info) +{ + struct mon_config_info *mon_info = info; + u32 h, index; + + index = mon_event_config_index_get(mon_info->evtid); + if (index == INVALID_CONFIG_INDEX) { + pr_warn_once("Invalid event id %d\n", mon_info->evtid); + return; + } + rdmsr(MSR_IA32_EVT_CFG_BASE + index, mon_info->mon_config, h); + + /* Report only the valid event configuration bits */ + mon_info->mon_config &= MAX_EVT_CONFIG_BITS; +} + +static void mondata_config_read(struct rdt_domain *d, struct mon_config_info *mon_info) +{ + smp_call_function_any(&d->cpu_mask, mon_event_config_read, mon_info, 1); +} + +static int mbm_config_show(struct seq_file *s, struct rdt_resource *r, u32 evtid) +{ + struct mon_config_info mon_info = {0}; + struct rdt_domain *dom; + bool sep = false; + + mutex_lock(&rdtgroup_mutex); + + list_for_each_entry(dom, &r->domains, list) { + if (sep) + seq_puts(s, ";"); + + mon_info.evtid = evtid; + mondata_config_read(dom, &mon_info); + + seq_printf(s, "%d=0x%02x", dom->id, mon_info.mon_config); + sep = true; + } + seq_puts(s, "\n"); + + mutex_unlock(&rdtgroup_mutex); + + return 0; +} + +static int mbm_total_bytes_config_show(struct kernfs_open_file *of, + struct seq_file *seq, void *v) +{ + struct rdt_resource *r = of->kn->parent->priv; + + mbm_config_show(seq, r, QOS_L3_MBM_TOTAL_EVENT_ID); + + return 0; +} + /* rdtgroup information files for one cache resource. */ static struct rftype res_common_files[] = { { @@ -1521,6 +1605,12 @@ static struct rftype res_common_files[] = { .seq_show = max_threshold_occ_show, .fflags = RF_MON_INFO | RFTYPE_RES_CACHE, }, + { + .name = "mbm_total_bytes_config", + .mode = 0444, + .kf_ops = &rdtgroup_kf_single_ops, + .seq_show = mbm_total_bytes_config_show, + }, { .name = "cpus", .mode = 0644, @@ -1627,6 +1717,15 @@ void __init thread_throttle_mode_init(void) rft->fflags = RF_CTRL_INFO | RFTYPE_RES_MB; } +void __init mbm_config_rftype_init(const char *config) +{ + struct rftype *rft; + + rft = rdtgroup_get_rftype_by_name(config); + if (rft) + rft->fflags = RF_MON_INFO | RFTYPE_RES_CACHE; +} + /** * rdtgroup_kn_mode_restrict - Restrict user access to named resctrl file * @r: The resource group with which the file is associated.