public inbox for linux-kselftest@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Reinette Chatre <reinette.chatre@intel.com>
Cc: fenghua.yu@intel.com, shuah@kernel.org, tony.luck@intel.com,
	peternewman@google.com, babu.moger@amd.com,
	"Maciej Wieczór-Retman" <maciej.wieczor-retman@intel.com>,
	linux-kselftest@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V2 12/13] selftests/resctrl: Do not compare performance counters and resctrl at low bandwidth
Date: Fri, 4 Oct 2024 17:23:13 +0300 (EEST)	[thread overview]
Message-ID: <b728c9c2-49a3-50b8-433a-b38e47a25303@linux.intel.com> (raw)
In-Reply-To: <955545d3377afc359d7b8b3915455bfdfc0d6605.1726164080.git.reinette.chatre@intel.com>

[-- Attachment #1: Type: text/plain, Size: 3766 bytes --]

On Thu, 12 Sep 2024, Reinette Chatre wrote:

> The MBA test incrementally throttles memory bandwidth, each time
> followed by a comparison between the memory bandwidth observed
> by the performance counters and resctrl respectively.
> 
> While a comparison between performance counters and resctrl is
> generally appropriate, they do not have an identical view of
> memory bandwidth. For example RAS features or memory performance
> features that generate memory traffic may drive accesses that are
> counted differently by performance counters and MBM respectively,
> for instance generating "overhead" traffic which is not counted
> against any specific RMID. As a ratio, this different view of memory
> bandwidth becomes more apparent at low memory bandwidths.
> 
> It is not practical to enable/disable the various features that
> may generate memory bandwidth to give performance counters and
> resctrl an identical view. Instead, do not compare performance
> counters and resctrl view of memory bandwidth when the memory
> bandwidth is low.
> 
> Bandwidth throttling behaves differently across platforms
> so it is not appropriate to drop measurement data simply based
> on the throttling level. Instead, use a threshold of 750MiB
> that has been observed to support adequate comparison between
> performance counters and resctrl.
> 
> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
> ---
> Changes since V1:
> - Fix code alignment and spacing.
> - Modify flow to use "continue" instead of "break" now that
>   earlier changes decreases throttling.
> - Expand comment of define to elaborate causes of discrepancy
>   between performance counters and MBM.
> ---
>  tools/testing/selftests/resctrl/mba_test.c |  7 +++++++
>  tools/testing/selftests/resctrl/resctrl.h  | 10 ++++++++++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/tools/testing/selftests/resctrl/mba_test.c b/tools/testing/selftests/resctrl/mba_test.c
> index d8d9637c1951..5c6063d0a77c 100644
> --- a/tools/testing/selftests/resctrl/mba_test.c
> +++ b/tools/testing/selftests/resctrl/mba_test.c
> @@ -98,6 +98,13 @@ static bool show_mba_info(unsigned long *bw_imc, unsigned long *bw_resc)
>  
>  		avg_bw_imc = sum_bw_imc / (NUM_OF_RUNS - 1);
>  		avg_bw_resc = sum_bw_resc / (NUM_OF_RUNS - 1);
> +		if (avg_bw_imc < THROTTLE_THRESHOLD || avg_bw_resc < THROTTLE_THRESHOLD) {
> +			ksft_print_msg("Bandwidth below threshold (%d MiB). Dropping results from MBA schemata %u.\n",
> +				       THROTTLE_THRESHOLD,
> +				       ALLOCATION_MIN + ALLOCATION_STEP * allocation);
> +			continue;
> +		}
> +
>  		avg_diff = (float)labs(avg_bw_resc - avg_bw_imc) / avg_bw_imc;
>  		avg_diff_per = (int)(avg_diff * 100);
>  
> diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h
> index dc01dc75cba5..eb151ac74938 100644
> --- a/tools/testing/selftests/resctrl/resctrl.h
> +++ b/tools/testing/selftests/resctrl/resctrl.h
> @@ -43,6 +43,16 @@
>  
>  #define DEFAULT_SPAN		(250 * MB)
>  
> +/*
> + * Memory bandwidth (in MiB) below which the bandwidth comparisons
> + * between iMC and resctrl are considered unreliable. For example RAS
> + * features or memory performance features that generate memory traffic
> + * may drive accesses that are counted differently by performance counters
> + * and MBM respectively, for instance generating "overhead" traffic which
> + * is not counted against any specific RMID.
> + */
> +#define THROTTLE_THRESHOLD	750
> +
>  /*
>   * fill_buf_param:	"fill_buf" benchmark parameters
>   * @buf_size:		Size (in bytes) of buffer used in benchmark.
> 

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

-- 
 i.

  reply	other threads:[~2024-10-04 14:23 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-12 18:13 [PATCH V2 00/13] selftests/resctrl: Support diverse platforms with MBM and MBA tests Reinette Chatre
2024-09-12 18:13 ` [PATCH V2 01/13] selftests/resctrl: Make functions only used in same file static Reinette Chatre
2024-09-12 18:13 ` [PATCH V2 02/13] selftests/resctrl: Print accurate buffer size as part of MBM results Reinette Chatre
2024-09-12 18:13 ` [PATCH V2 03/13] selftests/resctrl: Fix memory overflow due to unhandled wraparound Reinette Chatre
2024-09-30 13:16   ` Ilpo Järvinen
2024-09-12 18:13 ` [PATCH V2 04/13] selftests/resctrl: Protect against array overrun during iMC config parsing Reinette Chatre
2024-09-30 13:35   ` Ilpo Järvinen
2024-09-30 16:04     ` Reinette Chatre
2024-09-12 18:13 ` [PATCH V2 05/13] selftests/resctrl: Make wraparound handling obvious Reinette Chatre
2024-09-12 18:13 ` [PATCH V2 06/13] selftests/resctrl: Remove "once" parameter required to be false Reinette Chatre
2024-09-30 13:49   ` Ilpo Järvinen
2024-09-30 16:07     ` Reinette Chatre
2024-09-12 18:13 ` [PATCH V2 07/13] selftests/resctrl: Only support measured read operation Reinette Chatre
2024-09-30 13:52   ` Ilpo Järvinen
2024-09-30 16:05     ` Reinette Chatre
2024-09-12 18:13 ` [PATCH V2 08/13] selftests/resctrl: Remove unused measurement code Reinette Chatre
2024-09-30 13:59   ` Ilpo Järvinen
2024-09-12 18:13 ` [PATCH V2 09/13] selftests/resctrl: Make benchmark parameter passing robust Reinette Chatre
2024-10-04 14:05   ` Ilpo Järvinen
2024-10-04 22:21     ` Reinette Chatre
2024-09-12 18:13 ` [PATCH V2 10/13] selftests/resctrl: Ensure measurements skip initialization of default benchmark Reinette Chatre
2024-10-04 14:11   ` Ilpo Järvinen
2024-09-12 18:14 ` [PATCH V2 11/13] selftests/resctrl: Use cache size to determine "fill_buf" buffer size Reinette Chatre
2024-10-04 14:20   ` Ilpo Järvinen
2024-10-04 22:23     ` Reinette Chatre
2024-09-12 18:14 ` [PATCH V2 12/13] selftests/resctrl: Do not compare performance counters and resctrl at low bandwidth Reinette Chatre
2024-10-04 14:23   ` Ilpo Järvinen [this message]
2024-09-12 18:14 ` [PATCH V2 13/13] selftests/resctrl: Keep results from first test run Reinette Chatre
2024-10-04 14:29   ` Ilpo Järvinen
2024-10-04 22:24     ` Reinette Chatre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b728c9c2-49a3-50b8-433a-b38e47a25303@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=babu.moger@amd.com \
    --cc=fenghua.yu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=maciej.wieczor-retman@intel.com \
    --cc=peternewman@google.com \
    --cc=reinette.chatre@intel.com \
    --cc=shuah@kernel.org \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox