Skip to content

Commit 6c72fb8

Browse files
James Morsebp3tk0v
authored andcommitted
x86/resctrl: Move is_mba_sc() out of core.c
is_mba_sc() is defined in core.c, but has no callers there. It does not access any architecture private structures. Move this to rdtgroup.c where the majority of callers are. This makes the move of the filesystem code to /fs/ cleaner. Signed-off-by: James Morse <james.morse@arm.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Reviewed-by: Tony Luck <tony.luck@intel.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Reviewed-by: Fenghua Yu <fenghuay@nvidia.com> Tested-by: Fenghua Yu <fenghuay@nvidia.com> Tested-by: Carl Worth <carl@os.amperecomputing.com> # arm64 Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Tested-by: Peter Newman <peternewman@google.com> Tested-by: Amit Singh Tomar <amitsinght@marvell.com> # arm64 Tested-by: Shanker Donthineni <sdonthineni@nvidia.com> # arm64 Tested-by: Babu Moger <babu.moger@amd.com> Tested-by: Tony Luck <tony.luck@intel.com> Link: https://lore.kernel.org/20250515165855.31452-11-james.morse@arm.com
1 parent bc74042 commit 6c72fb8

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

arch/x86/kernel/cpu/resctrl/core.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -164,21 +164,6 @@ static inline void cache_alloc_hsw_probe(void)
164164
rdt_alloc_capable = true;
165165
}
166166

167-
bool is_mba_sc(struct rdt_resource *r)
168-
{
169-
if (!r)
170-
r = resctrl_arch_get_resource(RDT_RESOURCE_MBA);
171-
172-
/*
173-
* The software controller support is only applicable to MBA resource.
174-
* Make sure to check for resource type.
175-
*/
176-
if (r->rid != RDT_RESOURCE_MBA)
177-
return false;
178-
179-
return r->membw.mba_sc;
180-
}
181-
182167
/*
183168
* rdt_get_mb_table() - get a mapping of bandwidth(b/w) percentage values
184169
* exposed to user interface and the h/w understandable delay values.

arch/x86/kernel/cpu/resctrl/rdtgroup.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,6 +1535,21 @@ unsigned int rdtgroup_cbm_to_size(struct rdt_resource *r,
15351535
return size;
15361536
}
15371537

1538+
bool is_mba_sc(struct rdt_resource *r)
1539+
{
1540+
if (!r)
1541+
r = resctrl_arch_get_resource(RDT_RESOURCE_MBA);
1542+
1543+
/*
1544+
* The software controller support is only applicable to MBA resource.
1545+
* Make sure to check for resource type.
1546+
*/
1547+
if (r->rid != RDT_RESOURCE_MBA)
1548+
return false;
1549+
1550+
return r->membw.mba_sc;
1551+
}
1552+
15381553
/*
15391554
* rdtgroup_size_show - Display size in bytes of allocated regions
15401555
*

0 commit comments

Comments
 (0)