Re: [PATCH v5 1/5] selftests/resctrl: Rename variables and functions to generic names

From: Swapnil Sapkal

Date: Tue Nov 03 2026 - 01:16:01 EST


Hi Reinette,

Thanks for the review.

On 29-10-2026 00:08, Reinette Chatre wrote:
Hi Swapnil,

On 10/22/26 6:25 AM, Swapnil Sapkal wrote:
From: Babu Moger <babu.moger@xxxxxxx>

For Intel, the memory controller is called Integrated Memory Controller
(IMC). For AMD, it is called Unified Memory Controller (UMC).

Rename the variables and functions from imc (Integrated Memory
Controller) to the generic mc (Memory Controller) in preparation for
the support of MBM and MBA tests on AMD.

No functional change intended.

Assisted-by: Claude:claude-opus-4.8

There was a decision at LPC that this tag is no longer needed. This was
formalized with the following recent commit:
1e035297ffda ("docs: remove Assisted-by references")


Thank you for pointing to this.

Please remove the "Assisted-by:" tag from all patches and instead add
a statement to the cover letter about how AI was used during creation of
this series.


Sure, I will remove the tag and update the cover letter.

Signed-off-by: Babu Moger <babu.moger@xxxxxxx>
Co-developed-by: Swapnil Sapkal <swapnil.sapkal@xxxxxxx>
Signed-off-by: Swapnil Sapkal <swapnil.sapkal@xxxxxxx>
---

tools/testing/selftests/resctrl/mba_test.c | 28 +-
tools/testing/selftests/resctrl/mbm_test.c | 24 +-
tools/testing/selftests/resctrl/resctrl.h | 6 +-
tools/testing/selftests/resctrl/resctrl_val.c | 256 +++++++++---------
4 files changed, 157 insertions(+), 157 deletions(-)


diff --git a/tools/testing/selftests/resctrl/resctrl_val.c b/tools/testing/selftests/resctrl/resctrl_val.c
index 7e7d0f9cc249..c9cac957726b 100644
--- a/tools/testing/selftests/resctrl/resctrl_val.c
+++ b/tools/testing/selftests/resctrl/resctrl_val.c

...

@@ -83,20 +83,20 @@ static void get_read_event_and_umask(char *cas_count_cfg, struct imc_counter_con
if (!token[i])
break;
if (strcmp(token[i], "event") == 0)
- imc_counter->event = strtol(token[i + 1], NULL, 16);
+ mc_counter->event = strtol(token[i + 1], NULL, 16);
if (strcmp(token[i], "umask") == 0)
- imc_counter->umask = strtol(token[i + 1], NULL, 16);
+ mc_counter->umask = strtol(token[i + 1], NULL, 16);
}
}
-static int open_perf_read_event(int cpu_no, struct imc_counter_config *imc_counter)
+static int open_perf_read_event(int cpu_no, struct mc_counter_config *mc_counter)
{
- imc_counter->fd = perf_event_open(&imc_counter->pe, -1, cpu_no, -1,
+ mc_counter->fd = perf_event_open(&mc_counter->pe, -1, cpu_no, -1,
PERF_FLAG_FD_CLOEXEC);

nit: please fixup the alignment with open parenthesis

- if (imc_counter->fd == -1) {
+ if (mc_counter->fd == -1) {
fprintf(stderr, "Error opening leader %llx\n",
- imc_counter->pe.config);
+ mc_counter->pe.config);
return -1;
}


...

@@ -344,54 +344,54 @@ static int perf_open_imc_read_mem_bw(int cpu_no)
return 0;
close_fds:
- perf_close_imc_read_mem_bw();
+ perf_close_mc_read_mem_bw();
return -1;
}
/*
- * do_imc_read_mem_bw_test - Perform memory bandwidth test
+ * do_mc_read_mem_bw_test - Perform memory bandwidth test
*
* Runs memory bandwidth test over one second period. Also, handles starting
- * and stopping of the IMC perf counters around the test.
+ * and stopping of the MC perf counters around the test.
*/
-static void do_imc_read_mem_bw_test(void)
+static void do_mc_read_mem_bw_test(void)
{
- struct imc_counter_config *imc_counter;
+ struct mc_counter_config *mc_counter;
- list_for_each_entry(imc_counter, &imc_counters_list, entry)
- read_mem_bw_ioctl_perf_event_ioc_reset_enable(imc_counter);
+ list_for_each_entry(mc_counter, &mc_counters_list, entry)
+ read_mem_bw_ioctl_perf_event_ioc_reset_enable(mc_counter);
sleep(1);
/* Stop counters after a second to get results. */
- list_for_each_entry(imc_counter, &imc_counters_list, entry)
- read_mem_bw_ioctl_perf_event_ioc_disable(imc_counter);
+ list_for_each_entry(mc_counter, &mc_counters_list, entry)
+ read_mem_bw_ioctl_perf_event_ioc_disable(mc_counter);
}
/*
- * get_read_mem_bw_imc - Memory read bandwidth as reported by iMC counters
+ * get_read_mem_bw_mc - Memory read bandwidth as reported by MC counters
*
* Memory read bandwidth utilized by a process on a socket can be calculated
- * using iMC counters' read events. Perf events are used to read these
+ * using MC counters' read events. Perf events are used to read these
* counters.

nit: please move this dangling "counters." to the previous line.


Will update.

*
* Return: = 0 on success. < 0 on failure.
*/
-static int get_read_mem_bw_imc(float *bw_imc)
+static int get_read_mem_bw_mc(float *bw_mc)
| Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>


Ack.

Reinette
--
Thanks and Regards,
Swapnil