]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/resctrl: Move is_mba_sc() out of core.c
authorJames Morse <james.morse@arm.com>
Thu, 15 May 2025 16:58:40 +0000 (16:58 +0000)
committerBorislav Petkov (AMD) <bp@alien8.de>
Fri, 16 May 2025 08:06:45 +0000 (10:06 +0200)
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
arch/x86/kernel/cpu/resctrl/core.c
arch/x86/kernel/cpu/resctrl/rdtgroup.c

index 31538c65d9a21256c2c357e65bc373a3ab83f52d..58d7c6accdf2e85596cd62c28c8dd47d6a9ac560 100644 (file)
@@ -164,21 +164,6 @@ static inline void cache_alloc_hsw_probe(void)
        rdt_alloc_capable = true;
 }
 
-bool is_mba_sc(struct rdt_resource *r)
-{
-       if (!r)
-               r = resctrl_arch_get_resource(RDT_RESOURCE_MBA);
-
-       /*
-        * The software controller support is only applicable to MBA resource.
-        * Make sure to check for resource type.
-        */
-       if (r->rid != RDT_RESOURCE_MBA)
-               return false;
-
-       return r->membw.mba_sc;
-}
-
 /*
  * rdt_get_mb_table() - get a mapping of bandwidth(b/w) percentage values
  * exposed to user interface and the h/w understandable delay values.
index cfd846cc861e3c1e0ef6c662b26a8135c2c9acc7..e2999f6685934cd6da318e75a4866163feb18942 100644 (file)
@@ -1535,6 +1535,21 @@ unsigned int rdtgroup_cbm_to_size(struct rdt_resource *r,
        return size;
 }
 
+bool is_mba_sc(struct rdt_resource *r)
+{
+       if (!r)
+               r = resctrl_arch_get_resource(RDT_RESOURCE_MBA);
+
+       /*
+        * The software controller support is only applicable to MBA resource.
+        * Make sure to check for resource type.
+        */
+       if (r->rid != RDT_RESOURCE_MBA)
+               return false;
+
+       return r->membw.mba_sc;
+}
+
 /*
  * rdtgroup_size_show - Display size in bytes of allocated regions
  *