[PATCH v9 13/27] x86/resctrl: Move enum resctrl_event_id to resctrl.h

James Morse posted 27 patches 7 months, 3 weeks ago
There is a newer version of this series
[PATCH v9 13/27] x86/resctrl: Move enum resctrl_event_id to resctrl.h
Posted by James Morse 7 months, 3 weeks ago
A previous patch moved enum resctrl_event_id into a smaller header file,
resctrl_types.h, so that architectures could use these types in their
definitions of asm/resctrl.h. Specifically this was for
resctrl_arch_get_cdp_enabled() and resctrl_arch_set_cdp_enabled().

Those two functions are no longer inlined by any architecture, so
the enum can be moved to resctrl.h.

Signed-off-by: James Morse <james.morse@arm.com>
---
Changes since v8:
 * This patch is new.
---
 include/linux/resctrl.h       | 10 ++++++++++
 include/linux/resctrl_types.h | 10 ----------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h
index b9d1f2916e9c..5ef972cbf56b 100644
--- a/include/linux/resctrl.h
+++ b/include/linux/resctrl.h
@@ -48,6 +48,16 @@ int proc_resctrl_show(struct seq_file *m,
 	for_each_rdt_resource((r))					      \
 		if ((r)->mon_capable)
 
+enum resctrl_res_level {
+	RDT_RESOURCE_L3,
+	RDT_RESOURCE_L2,
+	RDT_RESOURCE_MBA,
+	RDT_RESOURCE_SMBA,
+
+	/* Must be the last */
+	RDT_NUM_RESOURCES,
+};
+
 /**
  * enum resctrl_conf_type - The type of configuration.
  * @CDP_NONE:	No prioritisation, both code and data are controlled or monitored.
diff --git a/include/linux/resctrl_types.h b/include/linux/resctrl_types.h
index a66e7936943e..a25fb9c4070d 100644
--- a/include/linux/resctrl_types.h
+++ b/include/linux/resctrl_types.h
@@ -34,16 +34,6 @@
 /* Max event bits supported */
 #define MAX_EVT_CONFIG_BITS		GENMASK(6, 0)
 
-enum resctrl_res_level {
-	RDT_RESOURCE_L3,
-	RDT_RESOURCE_L2,
-	RDT_RESOURCE_MBA,
-	RDT_RESOURCE_SMBA,
-
-	/* Must be the last */
-	RDT_NUM_RESOURCES,
-};
-
 /*
  * Event IDs, the values match those used to program IA32_QM_EVTSEL before
  * reading IA32_QM_CTR on RDT systems.
-- 
2.39.5
Re: [PATCH v9 13/27] x86/resctrl: Move enum resctrl_event_id to resctrl.h
Posted by Reinette Chatre 7 months, 3 weeks ago
Hi James,

On 4/25/25 10:37 AM, James Morse wrote:
> A previous patch moved enum resctrl_event_id into a smaller header file,

We have had trouble using "previous patch" and "next patch" in changelogs
because of how patches may be re-organized after merge and backports and such.

Considering this I'd propose something like (please feel free to improve):

  resctrl_types.h contains common types and constants to enable architectures
  to use these types in their definitions within asm/resctrl.h.
  
  enum resctrl_event_id was placed in resctrl_types.h for
  resctrl_arch_get_cdp_enabled() and resctrl_arch_set_cdp_enabled(), but
  these two functions are no longer inlined by any architecture.

  Move enum resctrl_event_id to resctrl.h.

> resctrl_types.h, so that architectures could use these types in their
> definitions of asm/resctrl.h. Specifically this was for
> resctrl_arch_get_cdp_enabled() and resctrl_arch_set_cdp_enabled().
> 
> Those two functions are no longer inlined by any architecture, so
> the enum can be moved to resctrl.h.
> 
> Signed-off-by: James Morse <james.morse@arm.com>
> ---

With "previous patch" addressed:
| Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>

Thank you.

Reinette
Re: [PATCH v9 13/27] x86/resctrl: Move enum resctrl_event_id to resctrl.h
Posted by James Morse 7 months, 2 weeks ago
Hi Reinette,

On 01/05/2025 18:19, Reinette Chatre wrote:
> On 4/25/25 10:37 AM, James Morse wrote:
>> A previous patch moved enum resctrl_event_id into a smaller header file,
> 
> We have had trouble using "previous patch" and "next patch" in changelogs
> because of how patches may be re-organized after merge and backports and such.

I glossed over this because it was the distant past!

> Considering this I'd propose something like (please feel free to improve):
> 
>   resctrl_types.h contains common types and constants to enable architectures
>   to use these types in their definitions within asm/resctrl.h.
>   
>   enum resctrl_event_id was placed in resctrl_types.h for
>   resctrl_arch_get_cdp_enabled() and resctrl_arch_set_cdp_enabled(), but
>   these two functions are no longer inlined by any architecture.
> 
>   Move enum resctrl_event_id to resctrl.h.

I've taken this as it is.


> With "previous patch" addressed:
> | Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>


Thanks!

James