[PATCH v2 0/6] selftests/resctrl: Add dynamic linked list management for IMC counters
From: Yifan Wu
Date: Fri Apr 10 2026 - 05:39:35 EST
Hi all,
This patch series adds dynamic linked list management for the IMC
counters, which can work based on the actual number of counters instead of
an upper limit, without the need for array out-of-bounds access check.
This patch series is based on the Reinette's patch series aimed at fixing
the resctrl test and can be found at:
https://lore.kernel.org/lkml/cover.1775266384.git.reinette.chatre@xxxxxxxxx/
changelog:
1. Fixed the code style and variable naming.
2. The initialization and cleanup of the linked list are integrated in patch 1.
3. The use of arrays is refactored to linked list split in the remaining patches.
4. The IMC count and global variable imcs are removed.
For more details, see the commit message.
v1 can be found at:
https://lore.kernel.org/all/20260324125034.1509177-1-wuyifan50@xxxxxxxxxx/
Yifan Wu (6):
selftests/resctrl: Introduced linked list management for IMC counters
selftests/resctrl: Refactor the discovery of IMC counters using linked
list
selftests/resctrl: Refactor the initialization of IMC's perf_event_attr
using linked list
selftests/resctrl: Refactor perf event open/close using linked list
selftests/resctrl: Refactor reading from IMC using linked list
selftests/resctrl: Remove the definition of the IMC counter config
array and imcs.
tools/testing/selftests/resctrl/mba_test.c | 1 +
tools/testing/selftests/resctrl/mbm_test.c | 1 +
tools/testing/selftests/resctrl/resctrl.h | 2 +
tools/testing/selftests/resctrl/resctrl_val.c | 147 ++++++++++--------
4 files changed, 82 insertions(+), 69 deletions(-)
--
2.43.0