Message ID | 20230126184157.27626-4-tony.luck@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp429220wrn; Thu, 26 Jan 2023 10:45:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXuXe0+WPUPEhkFOq1GZuxywXygN1+GrV/Dt2Mj8jg5x2dDerqRGhUY8O9acxru+pfceO2Gb X-Received: by 2002:a17:90b:348e:b0:229:5cab:67a8 with SMTP id kd14-20020a17090b348e00b002295cab67a8mr38015351pjb.24.1674758724161; Thu, 26 Jan 2023 10:45:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674758724; cv=none; d=google.com; s=arc-20160816; b=C3lGF3x9JBJjBQbOJq561fB3vAXx58WIT7vELz3cclayWz/kz2qdHlmwzl2srf3/hU gPvtNFVOexW7ACHqfcSq776QnU83nFLLfbE//FjnZeEIKmrzxq4nWyhEcDCoHwYWwIu4 yJUHjq/ljeXCuMPACoL12iEIFVcN3wHP/qXLsHZkuxS3nL38CxdrtenfZcAdDvmriNRw LRHUh5f/lwOti8ZQRQkEbAL9IMB3pS3I75I6cUs4YAZ9seWn0J0jlvLPHlu3JAs3acce ANlxI9EWvCfYBtIr9RQVrZy6uV/LjaRkau8ZoLNMdmFX6vww8Ws1OlAHt63+igro142a YZpg== ARC-Message-Signature: i=1; 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=PueeEeiVr/dRafxQRG+wR4MGAAsF8JZb6m2vuMC0LCo=; b=Gdw307kit9AJBKOyDYWiQDYVWLXn23URPU/HctIHi7DB73nASepeywoOIs0VrjR/kQ YIWcPTuc7cv7SO2eGtgz/KSaqSJ2mV3IMCws7qeIrsuE6ipTGcwWKEcP6r759izH/DL7 httkETE8X4OAbAwKgGO78hzPpAvWTjP9MkPQ1pKIk8jM3zMIfMOdfAOcfEaD77QZZRNV 53MqAKIZ1wTm6jyV9rlV8N9VNc2Emwr4RMuHQCU56YeL/UwJEojFZcklOXRRV9ll7mSd COLIbML6FUYqUrnnywYlymVFVmxAtxPD+0Mur/q9z49u9Y10JpNZpWrC7dffb3p1Xgis /Gnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TDv94L+z; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o14-20020a17090aac0e00b0022645e2a88csi2297238pjq.56.2023.01.26.10.45.10; Thu, 26 Jan 2023 10:45:24 -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=@intel.com header.s=Intel header.b=TDv94L+z; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232212AbjAZSmo (ORCPT <rfc822;lekhanya01809@gmail.com> + 99 others); Thu, 26 Jan 2023 13:42:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230019AbjAZSmd (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 26 Jan 2023 13:42:33 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68E4E402D8; Thu, 26 Jan 2023 10:42:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674758552; x=1706294552; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sfw55e9pOISjtn87W0zcDQDfivg/FZE8hQOsm+yl2hY=; b=TDv94L+z2Z7d5rlAohU44bWNGIfKDhy0ZHcIxF2eo35NDF1AButwlqSb rxOACzKAQbcVJuxNrnGZopohLB2SGb9l8vaKy6O4Je5FhBWeC893Q+KwG 9SNKbDKSvGWOL/hJTR6efFf//Dgdr2NjPzN3lbXyS2/25MDQB+M8QiGiV R1rlS7s/8OaNQlbX4Kj2zi+BTl1Tl/25WPwAmEAVaQQPC3BDBaj9JExed U4HDVEIPmLdN21L76PvS9xAk6MkwLJA79YS1fXGuOqtTtGvymP9w16PD4 uKlQ44we40M4ptYKseRgXQ0I7iHVP2/P8xBf8htkFhmw/ROdJhc505rd3 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10602"; a="354203341" X-IronPort-AV: E=Sophos;i="5.97,249,1669104000"; d="scan'208";a="354203341" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2023 10:42:06 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10602"; a="991745445" X-IronPort-AV: E=Sophos;i="5.97,249,1669104000"; d="scan'208";a="991745445" Received: from agluck-desk3.sc.intel.com ([172.25.222.78]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2023 10:42:05 -0800 From: Tony Luck <tony.luck@intel.com> To: Fenghua Yu <fenghua.yu@intel.com>, Reinette Chatre <reinette.chatre@intel.com>, Peter Newman <peternewman@google.com>, Jonathan Corbet <corbet@lwn.net>, x86@kernel.org Cc: Shaopeng Tan <tan.shaopeng@fujitsu.com>, James Morse <james.morse@arm.com>, Jamie Iles <quic_jiles@quicinc.com>, Babu Moger <babu.moger@amd.com>, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, patches@lists.linux.dev, Tony Luck <tony.luck@intel.com> Subject: [PATCH 3/7] x86/resctrl: Add a new node-scoped resource to rdt_resources_all[] Date: Thu, 26 Jan 2023 10:41:53 -0800 Message-Id: <20230126184157.27626-4-tony.luck@intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230126184157.27626-1-tony.luck@intel.com> References: <20230126184157.27626-1-tony.luck@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756111804282714673?= X-GMAIL-MSGID: =?utf-8?q?1756111804282714673?= |
Series |
x86/resctrl: Add support for Sub-NUMA cluster (SNC) systems
|
|
Commit Message
Luck, Tony
Jan. 26, 2023, 6:41 p.m. UTC
Add a placeholder in the array of struct rdt_hw_resource to be used
for event monitoring of systems with Sub-NUMA Cluster enabled.
Update get_domain_id() to handle SCOPE_NODE.
Signed-off-by: Tony Luck <tony.luck@intel.com>
---
arch/x86/kernel/cpu/resctrl/internal.h | 2 ++
arch/x86/kernel/cpu/resctrl/core.c | 12 ++++++++++++
2 files changed, 14 insertions(+)
Comments
Hi, Tony, On 1/26/23 10:41, Tony Luck wrote: > Add a placeholder in the array of struct rdt_hw_resource to be used > for event monitoring of systems with Sub-NUMA Cluster enabled. > > Update get_domain_id() to handle SCOPE_NODE. > > Signed-off-by: Tony Luck <tony.luck@intel.com> > --- > arch/x86/kernel/cpu/resctrl/internal.h | 2 ++ > arch/x86/kernel/cpu/resctrl/core.c | 12 ++++++++++++ > 2 files changed, 14 insertions(+) > > diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h > index 15cea517efaa..39a62babd60b 100644 > --- a/arch/x86/kernel/cpu/resctrl/internal.h > +++ b/arch/x86/kernel/cpu/resctrl/internal.h > @@ -409,12 +409,14 @@ enum resctrl_res_level { > RDT_RESOURCE_L3, > RDT_RESOURCE_L2, > RDT_RESOURCE_MBA, > + RDT_RESOURCE_NODE, > > /* Must be the last */ > RDT_NUM_RESOURCES, > }; > > enum resctrl_scope { > + SCOPE_NODE, > SCOPE_L2_CACHE = 2, > SCOPE_L3_CACHE = 3 > }; > diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c > index 6914232acf84..19be6fe42ef3 100644 > --- a/arch/x86/kernel/cpu/resctrl/core.c > +++ b/arch/x86/kernel/cpu/resctrl/core.c > @@ -100,6 +100,16 @@ struct rdt_hw_resource rdt_resources_all[] = { > .fflags = RFTYPE_RES_MB, > }, > }, > + [RDT_RESOURCE_NODE] = > + { > + .r_resctrl = { > + .rid = RDT_RESOURCE_NODE, > + .name = "L3", "L3" was named as RDT_RESOURCE_L3 already. The duplicate name here may cause duplicate file names in info dir. Maybe rename it as "L3_NODE"? > + .scope = SCOPE_NODE, > + .domains = domain_init(RDT_RESOURCE_NODE), > + .fflags = RFTYPE_RES_MB, I'm not sure if fflags is RFTYPE_RES_MB | RFTYPE_RES_L3 for both cache and MB? > + }, > + }, > }; > > /* > @@ -464,6 +474,8 @@ static int arch_domain_mbm_alloc(u32 num_rmid, struct rdt_hw_domain *hw_dom) > > static int get_domain_id(int cpu, enum resctrl_scope scope) > { > + if (scope == SCOPE_NODE) > + return cpu_to_node(cpu); > return get_cpu_cacheinfo_id(cpu, scope); > } > Thanks. -Fenghua
Hi Tony, On Fri, Jan 27, 2023 at 6:25 AM Yu, Fenghua <fenghua.yu@intel.com> wrote: > > On 1/26/23 10:41, Tony Luck wrote: > > diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c > > index 6914232acf84..19be6fe42ef3 100644 > > --- a/arch/x86/kernel/cpu/resctrl/core.c > > +++ b/arch/x86/kernel/cpu/resctrl/core.c > > @@ -100,6 +100,16 @@ struct rdt_hw_resource rdt_resources_all[] = { > > .fflags = RFTYPE_RES_MB, > > }, > > }, > > + [RDT_RESOURCE_NODE] = > > + { > > + .r_resctrl = { > > + .rid = RDT_RESOURCE_NODE, > > + .name = "L3", > "L3" was named as RDT_RESOURCE_L3 already. The duplicate name here may > cause duplicate file names in info dir. Maybe rename it as "L3_NODE"? I'm trying to get some feedback from our own users on whether changing the directory names would bother them. At least from my own testing, I did learn to appreciate the interface change a bit more: I needed an SNC and non-SNC case to correctly predict which mon_data subdirectory the data would appear in. I was able to confirm that this change allows bandwidth to be counted on RMID/CPU combos where it didn't work before on an SNC2 configuration. If I'm understanding this correctly, it might be helpful to highlight that the extra resource is needed to allow a different number of L3 domains in L3 monitoring vs allocation. Thanks! -Peter Tested-By: Peter Newman <peternewman@google.com> Reviewed-By: Peter Newman <peternewman@google.com>
>> + [RDT_RESOURCE_NODE] = >> + { >> + .r_resctrl = { >> + .rid = RDT_RESOURCE_NODE, >> + .name = "L3", > "L3" was named as RDT_RESOURCE_L3 already. The duplicate name here may > cause duplicate file names in info dir. Maybe rename it as "L3_NODE"? I thought the same, and my first implementation used a different string here (I picked "NODE" rather than "L3_NODE"). But my testers complained that this broke all their existing infrastructure that reads cache occupancy and memory bandwidth. This string is not just used in the info/ directory, it is also the basis for the directory names in mon_data/ $ tree /sys/fs/resctrl/mon_data /sys/fs/resctrl/mon_data ├── mon_L3_00 │ ├── llc_occupancy │ ├── mbm_local_bytes │ └── mbm_total_bytes ├── mon_L3_01 │ ├── llc_occupancy │ ├── mbm_local_bytes │ └── mbm_total_bytes ├── mon_L3_02 │ ├── llc_occupancy │ ├── mbm_local_bytes │ └── mbm_total_bytes └── mon_L3_03 ├── llc_occupancy ├── mbm_local_bytes └── mbm_total_bytes The name using "L3" is still appropriate and accurate. There isn't a "duplicate file names" problem in the info/ directory because a system either has SNC disabled, and uses the L3-scoped resource, or has SNC enabled and uses the node-scoped resource. -Tony
Hi, Tony, On 1/26/23 10:41, Tony Luck wrote: > diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c > index 6914232acf84..19be6fe42ef3 100644 > --- a/arch/x86/kernel/cpu/resctrl/core.c > +++ b/arch/x86/kernel/cpu/resctrl/core.c > @@ -100,6 +100,16 @@ struct rdt_hw_resource rdt_resources_all[] = { > .fflags = RFTYPE_RES_MB, > }, > }, > + [RDT_RESOURCE_NODE] = > + { > + .r_resctrl = { > + .rid = RDT_RESOURCE_NODE, > + .name = "L3", > + .scope = SCOPE_NODE, > + .domains = domain_init(RDT_RESOURCE_NODE), > + .fflags = RFTYPE_RES_MB, RFTYPE_RES_MB is for the resource to add some files in info/MB. But the NODE resource doesn't have any files to show in info/MB. Only shown file for the NODE resource is info/L3_MON/snc_ways. But this file doesn't need to set fflags. Maybe Thanks. -Fenghua
Hi, Tony, On 1/27/23 10:23, Luck, Tony wrote: >>> + [RDT_RESOURCE_NODE] = >>> + { >>> + .r_resctrl = { >>> + .rid = RDT_RESOURCE_NODE, >>> + .name = "L3", > >> "L3" was named as RDT_RESOURCE_L3 already. The duplicate name here may >> cause duplicate file names in info dir. Maybe rename it as "L3_NODE"? > > I thought the same, and my first implementation used a different string here (I picked > "NODE" rather than "L3_NODE"). > > But my testers complained that this broke all their existing infrastructure that reads > cache occupancy and memory bandwidth. This string is not just used in the info/ > directory, it is also the basis for the directory names in mon_data/ > > $ tree /sys/fs/resctrl/mon_data > /sys/fs/resctrl/mon_data > ├── mon_L3_00 > │ ├── llc_occupancy > │ ├── mbm_local_bytes > │ └── mbm_total_bytes > ├── mon_L3_01 > │ ├── llc_occupancy > │ ├── mbm_local_bytes > │ └── mbm_total_bytes > ├── mon_L3_02 > │ ├── llc_occupancy > │ ├── mbm_local_bytes > │ └── mbm_total_bytes > └── mon_L3_03 > ├── llc_occupancy > ├── mbm_local_bytes > └── mbm_total_bytes > > The name using "L3" is still appropriate and accurate. > > There isn't a "duplicate file names" problem in the info/ directory because a system > either has SNC disabled, and uses the L3-scoped resource, or has SNC enabled and > uses the node-scoped resource. That's right. Thank you for your info! -Fenghua
Hi, Tony, On 1/26/23 10:41, Tony Luck wrote: > diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c > index 6914232acf84..19be6fe42ef3 100644 > --- a/arch/x86/kernel/cpu/resctrl/core.c > +++ b/arch/x86/kernel/cpu/resctrl/core.c > @@ -100,6 +100,16 @@ struct rdt_hw_resource rdt_resources_all[] = { > .fflags = RFTYPE_RES_MB, > }, > }, > + [RDT_RESOURCE_NODE] = > + { > + .r_resctrl = { > + .rid = RDT_RESOURCE_NODE, > + .name = "L3", > + .scope = SCOPE_NODE, > + .domains = domain_init(RDT_RESOURCE_NODE), > + .fflags = RFTYPE_RES_MB, RFTYPE_RES_MB is for the resource to add some files in info/MB. But the NODE resource doesn't have any files to show in info/MB. Only shown file for the NODE resource is info/L3_MON/snc_ways. But this file doesn't need to set fflags. Seems no need to set fflags or fflags=0 to eliminate confusion? Thanks. -Fenghua
>> + .domains = domain_init(RDT_RESOURCE_NODE), >> + .fflags = RFTYPE_RES_MB, > RFTYPE_RES_MB is for the resource to add some files in info/MB. > But the NODE resource doesn't have any files to show in info/MB. > > Only shown file for the NODE resource is info/L3_MON/snc_ways. But this > file doesn't need to set fflags. > > Seems no need to set fflags or fflags=0 to eliminate confusion? I just cut & pasted from the L3 ... oops. I think you may be right that an explicit ".fflags = 0" would be best here. -Tony
Hi Tony, Sorry for the late response. I was looking at your patches. Do you really need a new resource [RDT_RESOURCE_NODE] to handle this feature? As far as I can see, all that matters is writing/reading the MSRs IA32_PQR_ASSOC and IA32_QM_EVTSEL based on cpu index. I think that can be done without having the new resource. Let me know if I have misunderstood something. Thanks Babu > -----Original Message----- > From: Tony Luck <tony.luck@intel.com> > Sent: Thursday, January 26, 2023 12:42 PM > To: Fenghua Yu <fenghua.yu@intel.com>; Reinette Chatre > <reinette.chatre@intel.com>; Peter Newman <peternewman@google.com>; > Jonathan Corbet <corbet@lwn.net>; x86@kernel.org > Cc: Shaopeng Tan <tan.shaopeng@fujitsu.com>; James Morse > <james.morse@arm.com>; Jamie Iles <quic_jiles@quicinc.com>; Moger, Babu > <Babu.Moger@amd.com>; linux-kernel@vger.kernel.org; linux- > doc@vger.kernel.org; patches@lists.linux.dev; Tony Luck > <tony.luck@intel.com> > Subject: [PATCH 3/7] x86/resctrl: Add a new node-scoped resource to > rdt_resources_all[] > > Add a placeholder in the array of struct rdt_hw_resource to be used for event > monitoring of systems with Sub-NUMA Cluster enabled. > > Update get_domain_id() to handle SCOPE_NODE. > > Signed-off-by: Tony Luck <tony.luck@intel.com> > --- > arch/x86/kernel/cpu/resctrl/internal.h | 2 ++ > arch/x86/kernel/cpu/resctrl/core.c | 12 ++++++++++++ > 2 files changed, 14 insertions(+) > > diff --git a/arch/x86/kernel/cpu/resctrl/internal.h > b/arch/x86/kernel/cpu/resctrl/internal.h > index 15cea517efaa..39a62babd60b 100644 > --- a/arch/x86/kernel/cpu/resctrl/internal.h > +++ b/arch/x86/kernel/cpu/resctrl/internal.h > @@ -409,12 +409,14 @@ enum resctrl_res_level { > RDT_RESOURCE_L3, > RDT_RESOURCE_L2, > RDT_RESOURCE_MBA, > + RDT_RESOURCE_NODE, > > /* Must be the last */ > RDT_NUM_RESOURCES, > }; > > enum resctrl_scope { > + SCOPE_NODE, > SCOPE_L2_CACHE = 2, > SCOPE_L3_CACHE = 3 > }; > diff --git a/arch/x86/kernel/cpu/resctrl/core.c > b/arch/x86/kernel/cpu/resctrl/core.c > index 6914232acf84..19be6fe42ef3 100644 > --- a/arch/x86/kernel/cpu/resctrl/core.c > +++ b/arch/x86/kernel/cpu/resctrl/core.c > @@ -100,6 +100,16 @@ struct rdt_hw_resource rdt_resources_all[] = { > .fflags = RFTYPE_RES_MB, > }, > }, > + [RDT_RESOURCE_NODE] = > + { > + .r_resctrl = { > + .rid = RDT_RESOURCE_NODE, > + .name = "L3", > + .scope = SCOPE_NODE, > + .domains = > domain_init(RDT_RESOURCE_NODE), > + .fflags = RFTYPE_RES_MB, > + }, > + }, > }; > > /* > @@ -464,6 +474,8 @@ static int arch_domain_mbm_alloc(u32 num_rmid, > struct rdt_hw_domain *hw_dom) > > static int get_domain_id(int cpu, enum resctrl_scope scope) { > + if (scope == SCOPE_NODE) > + return cpu_to_node(cpu); > return get_cpu_cacheinfo_id(cpu, scope); } > > -- > 2.39.1
Babu, Thanks for looking at my patches. > Do you really need a new resource [RDT_RESOURCE_NODE] to handle this > feature? Yes. When sub-numa cluster mode is enabled, there are separate counts for each "node" on the socket. This new resource is the key to creating extra directories in the /sys/fs/resctrl/mon_data/ area so that the memory bandwidth and cache occupancy can be read for each node, instead of just for each socket. But there are some other issues with this patch series. New version will be posted once they are fixed up. -Tony
diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index 15cea517efaa..39a62babd60b 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -409,12 +409,14 @@ enum resctrl_res_level { RDT_RESOURCE_L3, RDT_RESOURCE_L2, RDT_RESOURCE_MBA, + RDT_RESOURCE_NODE, /* Must be the last */ RDT_NUM_RESOURCES, }; enum resctrl_scope { + SCOPE_NODE, SCOPE_L2_CACHE = 2, SCOPE_L3_CACHE = 3 }; diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c index 6914232acf84..19be6fe42ef3 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -100,6 +100,16 @@ struct rdt_hw_resource rdt_resources_all[] = { .fflags = RFTYPE_RES_MB, }, }, + [RDT_RESOURCE_NODE] = + { + .r_resctrl = { + .rid = RDT_RESOURCE_NODE, + .name = "L3", + .scope = SCOPE_NODE, + .domains = domain_init(RDT_RESOURCE_NODE), + .fflags = RFTYPE_RES_MB, + }, + }, }; /* @@ -464,6 +474,8 @@ static int arch_domain_mbm_alloc(u32 num_rmid, struct rdt_hw_domain *hw_dom) static int get_domain_id(int cpu, enum resctrl_scope scope) { + if (scope == SCOPE_NODE) + return cpu_to_node(cpu); return get_cpu_cacheinfo_id(cpu, scope); }