Re: [PATCH v5 4/5] selftests/resctrl: Use bandwidth values for AMD MBA schemata

From: Babu Moger

Date: Fri Nov 06 2026 - 16:26:27 EST


Hi Reinette,

On 11/4/26 22:16, Reinette Chatre wrote:
Hi Swapnil,

On 11/4/26 8:05 PM, Swapnil Sapkal wrote:
On 29-10-2026 00:15, Reinette Chatre wrote:
On 10/22/26 6:25 AM, Swapnil Sapkal wrote:

diff --git a/tools/testing/selftests/resctrl/mba_test.c b/tools/testing/selftests/resctrl/mba_test.c
index 17ae73d3476c..947735e26099 100644
--- a/tools/testing/selftests/resctrl/mba_test.c
+++ b/tools/testing/selftests/resctrl/mba_test.c
@@ -13,10 +13,51 @@
  #define RESULT_FILE_NAME    "result_mba"
  #define NUM_OF_RUNS        5
  #define MAX_DIFF_PERCENT    15
+
+/* Intel MBA is specified as a percentage: 10%, 20% ... 100%. */

The percentage based interface is the generic interface and not Intel specific.
You can drop "Intel" from references to this interface.


Sure, will do.

  #define ALLOCATION_MAX        100
  #define ALLOCATION_MIN        10
  #define ALLOCATION_STEP        10
  +/*
+ * AMD MBA is not a percentage but an absolute memory bandwidth value. The
+ * test sweeps the bandwidth from 4 GB/s to 40 GB/s in steps of 4 GB/s,
+ * which the hardware represents in units of 1/8 GB/s (i.e. 4 GB/s -> 32,
+ * 8 GB/s -> 64, ... 40 GB/s -> 320).
+ */
+#define AMD_ALLOCATION_MAX    320

The AMD maximum is enumerated from hardware. How can it be ensured this is
the appropriate maximum for all AMD systems?


As Babu mentioned, it's difficult for a single-threaded workload to
reach the hardware-reported value. For that reason, I used these
values to verify whether throttling takes effect.

Just to confirm, my question was not about needing this value to be the actual
maximum of a system. Instead, I just wanted to confirm that this "320" value that
is hardcoded here for all AMD systems is a _valid_ value. Since the actual maximum
value is enumerated from hardware it is not obvious to me that all systems will support
this hardcoded maximum.


The value 320 corresponds to 40 GB/s. I have tested this on several systems and was able to achieve the expected 40 GB/s bandwidth. The tests did not fail.

There are some older systems where the test is not expected to run because AMD UMC support is not available.

If you are concerned, since we are no longer depending on the maximum value, we can be conservative and start with the following adjusted values:

#define AMD_ALLOCATION_MIN 32
#define AMD_ALLOCATION_STEP 16

This allows the value to reach 32 + 16 × 10(num_allocs) = 192, which corresponds to approximately 24 GB/s.

Hope this answers your question.

Thanks,
Babu