[PATCH v11 31/31] fs/resctrl: Some kerneldoc updates

Tony Luck posted 31 patches 4 months, 2 weeks ago
There is a newer version of this series
[PATCH v11 31/31] fs/resctrl: Some kerneldoc updates
Posted by Tony Luck 4 months, 2 weeks ago
resctrl event monitoring on Sub-NUMA Cluster (SNC) systems sums the
counts for events across all nodes sharing an L3 cache.

Update the kerneldoc for rmid_read::sum and the do_sum argument to
mon_get_kn_priv() to say these are only used on the RDT_RESOURCE_L3
resource.

Add Return: value description for l3_mon_domain_mbm_alloc(),
resctrl_l3_mon_resource_init(), and domain_setup_l3_mon_state()

Signed-off-by: Tony Luck <tony.luck@intel.com>
---
 fs/resctrl/internal.h              | 4 ++--
 arch/x86/kernel/cpu/resctrl/core.c | 2 ++
 fs/resctrl/monitor.c               | 2 +-
 fs/resctrl/rdtgroup.c              | 5 +++--
 4 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/fs/resctrl/internal.h b/fs/resctrl/internal.h
index 223a6cc6a64a..0dd89d3fa31a 100644
--- a/fs/resctrl/internal.h
+++ b/fs/resctrl/internal.h
@@ -96,8 +96,8 @@ extern struct mon_evt mon_event_all[QOS_NUM_EVENTS];
  * @list:            Member of the global @mon_data_kn_priv_list list.
  * @rid:             Resource id associated with the event file.
  * @evt:             Event structure associated with the event file.
- * @sum:             Set when event must be summed across multiple
- *                   domains.
+ * @sum:             Set for RDT_RESOURCE_L3 when event must be summed
+ *                   across multiple domains.
  * @domid:           When @sum is zero this is the domain to which
  *                   the event file belongs. When @sum is one this
  *                   is the id of the L3 cache that all domains to be
diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
index 48ed6242d136..78c176e15b93 100644
--- a/arch/x86/kernel/cpu/resctrl/core.c
+++ b/arch/x86/kernel/cpu/resctrl/core.c
@@ -418,6 +418,8 @@ static int domain_setup_ctrlval(struct rdt_resource *r, struct rdt_ctrl_domain *
  * l3_mon_domain_mbm_alloc() - Allocate arch private storage for the MBM counters
  * @num_rmid:	The size of the MBM counter array
  * @hw_dom:	The domain that owns the allocated arrays
+ *
+ * Return:	%0 for success; Error code otherwise.
  */
 static int l3_mon_domain_mbm_alloc(u32 num_rmid, struct rdt_hw_l3_mon_domain *hw_dom)
 {
diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c
index c0e1b672afce..4cc310b9e78e 100644
--- a/fs/resctrl/monitor.c
+++ b/fs/resctrl/monitor.c
@@ -1811,7 +1811,7 @@ static void closid_num_dirty_rmid_free(void)
  * Resctrl's cpuhp callbacks may be called before this point to bring a domain
  * online.
  *
- * Returns 0 for success, or -ENOMEM.
+ * Return: %0 for success; Error code otherwise.
  */
 int resctrl_l3_mon_resource_init(void)
 {
diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
index 16b088c5f2be..04765dad3d31 100644
--- a/fs/resctrl/rdtgroup.c
+++ b/fs/resctrl/rdtgroup.c
@@ -3037,7 +3037,8 @@ static void rmdir_all_sub(void)
  * @rid:    The resource id for the event file being created.
  * @domid:  The domain id for the event file being created.
  * @mevt:   The type of event file being created.
- * @do_sum: Whether SNC summing monitors are being created.
+ * @do_sum: Whether SNC summing monitors are being created. Only set
+ *          when @rid == RDT_RESOURCE_L3.
  */
 static struct mon_data *mon_get_kn_priv(enum resctrl_res_level rid, int domid,
 					struct mon_evt *mevt,
@@ -4281,7 +4282,7 @@ void resctrl_offline_mon_domain(struct rdt_resource *r, struct rdt_domain_hdr *h
  * at mount time. This means the rdt_l3_mon_domain::mbm_states[] and
  * rdt_l3_mon_domain::rmid_busy_llc allocations may be larger than needed.
  *
- * Returns 0 for success, or -ENOMEM.
+ * Return: %0 for success; Error code otherwise.
  */
 static int domain_setup_l3_mon_state(struct rdt_resource *r, struct rdt_l3_mon_domain *d)
 {
-- 
2.51.0
Re: [PATCH v11 31/31] fs/resctrl: Some kerneldoc updates
Posted by Reinette Chatre 4 months, 1 week ago
Hi Tony,

On 9/25/25 1:03 PM, Tony Luck wrote:
> resctrl event monitoring on Sub-NUMA Cluster (SNC) systems sums the
> counts for events across all nodes sharing an L3 cache.
> 
> Update the kerneldoc for rmid_read::sum and the do_sum argument to
> mon_get_kn_priv() to say these are only used on the RDT_RESOURCE_L3
> resource.

This is clear from the patch. Why is this needed as part of
telemetry event enabling? Perhaps this can be combined with the
unrelated SNC warnings found in "x86/resctrl: Handle domain creation/deletion
for RDT_RESOURCE_PERF_PKG" to be a patch dedicated to addressing SNC
topics related to telemetry events? 

> 
> Add Return: value description for l3_mon_domain_mbm_alloc(),
> resctrl_l3_mon_resource_init(), and domain_setup_l3_mon_state()

Appreciate the cleanups but please have series start with cleanups instead of end.

> 
> Signed-off-by: Tony Luck <tony.luck@intel.com>
> ---

Reinette
Re: [PATCH v11 31/31] fs/resctrl: Some kerneldoc updates
Posted by Luck, Tony 4 months ago
On Fri, Oct 03, 2025 at 05:26:45PM -0700, Reinette Chatre wrote:
> Hi Tony,
> 
> On 9/25/25 1:03 PM, Tony Luck wrote:
> > resctrl event monitoring on Sub-NUMA Cluster (SNC) systems sums the
> > counts for events across all nodes sharing an L3 cache.
> > 
> > Update the kerneldoc for rmid_read::sum and the do_sum argument to
> > mon_get_kn_priv() to say these are only used on the RDT_RESOURCE_L3
> > resource.
> 
> This is clear from the patch. Why is this needed as part of
> telemetry event enabling? Perhaps this can be combined with the
> unrelated SNC warnings found in "x86/resctrl: Handle domain creation/deletion
> for RDT_RESOURCE_PERF_PKG" to be a patch dedicated to addressing SNC
> topics related to telemetry events? 

I will add an SNC cleanup patch to the series and make these changes there.
> 
> > 
> > Add Return: value description for l3_mon_domain_mbm_alloc(),
> > resctrl_l3_mon_resource_init(), and domain_setup_l3_mon_state()
> 
> Appreciate the cleanups but please have series start with cleanups instead of end.

Can I bundle these cleanups with patch 8 that renames these functions?

> 
> > 
> > Signed-off-by: Tony Luck <tony.luck@intel.com>
> > ---
> 
> Reinette
Re: [PATCH v11 31/31] fs/resctrl: Some kerneldoc updates
Posted by Reinette Chatre 4 months ago
Hi Tony,

On 10/6/25 9:54 AM, Luck, Tony wrote:
> On Fri, Oct 03, 2025 at 05:26:45PM -0700, Reinette Chatre wrote:
>> Hi Tony,
>>
>> On 9/25/25 1:03 PM, Tony Luck wrote:
>>> resctrl event monitoring on Sub-NUMA Cluster (SNC) systems sums the
>>> counts for events across all nodes sharing an L3 cache.
>>>
>>> Update the kerneldoc for rmid_read::sum and the do_sum argument to
>>> mon_get_kn_priv() to say these are only used on the RDT_RESOURCE_L3
>>> resource.
>>
>> This is clear from the patch. Why is this needed as part of
>> telemetry event enabling? Perhaps this can be combined with the
>> unrelated SNC warnings found in "x86/resctrl: Handle domain creation/deletion
>> for RDT_RESOURCE_PERF_PKG" to be a patch dedicated to addressing SNC
>> topics related to telemetry events? 
> 
> I will add an SNC cleanup patch to the series and make these changes there.

Thank you very much.

>>
>>>
>>> Add Return: value description for l3_mon_domain_mbm_alloc(),
>>> resctrl_l3_mon_resource_init(), and domain_setup_l3_mon_state()
>>
>> Appreciate the cleanups but please have series start with cleanups instead of end.
> 
> Can I bundle these cleanups with patch 8 that renames these functions?

Good question. It is ok with me. I am not aware of concerns with doing something like
this.

Reinette