From: Reinette Chatre <reinette.chatre@intel.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
"Fenghua Yu" <fenghua.yu@intel.com>,
"Shuah Khan" <shuah@kernel.org>
Subject: Re: [PATCH 2/4] selftests/resctrl: Don't hard code divisor in MBM results
Date: Mon, 13 Feb 2023 16:59:29 -0800 [thread overview]
Message-ID: <8ed0dcbd-86af-2658-95de-fdccffba7728@intel.com> (raw)
In-Reply-To: <20230208094026.22529-3-ilpo.jarvinen@linux.intel.com>
Hi Ilpo,
The subject is "Don't hard code divisor ..." yet it seems to me
that the hard coding persists. It is just changed from a magic
constant to a macro.
On 2/8/2023 1:40 AM, Ilpo Järvinen wrote:
> From: Fenghua Yu <fenghua.yu@intel.com>
>
> Presently, while calculating MBM results, the divisor is hard coded as 4.
"Presently" can be removed. Here and in the rest of the series the usage of
"presently" and "currently" can usually be removed to improve clarity.
> It's hard coded to 4 because "NUM_OF_RUNS" is defined as 5 and the test
> does not count first result and hence 4. So, instead of hard coding the
> value to 4, change it to NUM_OF_RUNS - 1.
Are there any plans surrounding using struct resctrl_val_param::num_of_runs
instead?
>
> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Missing your Signed-off-by?
> ---
> tools/testing/selftests/resctrl/mbm_test.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/resctrl/mbm_test.c b/tools/testing/selftests/resctrl/mbm_test.c
> index 8392e5c55ed0..4f85cbbfd037 100644
> --- a/tools/testing/selftests/resctrl/mbm_test.c
> +++ b/tools/testing/selftests/resctrl/mbm_test.c
> @@ -31,8 +31,8 @@ show_bw_info(unsigned long *bw_imc, unsigned long *bw_resc, int span)
> sum_bw_resc += bw_resc[runs];
> }
>
> - avg_bw_imc = sum_bw_imc / 4;
> - avg_bw_resc = sum_bw_resc / 4;
> + avg_bw_imc = sum_bw_imc / (NUM_OF_RUNS - 1);
> + avg_bw_resc = sum_bw_resc / (NUM_OF_RUNS - 1);
> avg_diff = (float)labs(avg_bw_resc - avg_bw_imc) / avg_bw_imc;
> avg_diff_per = (int)(avg_diff * 100);
>
Reinette
next prev parent reply other threads:[~2023-02-14 0:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-08 9:40 [PATCH 0/4] selftests/resctrl: Small cleanups Ilpo Järvinen
2023-02-08 9:40 ` [PATCH 1/4] selftests/resctrl: Change initialize_llc_perf() return type to void Ilpo Järvinen
2023-02-14 0:59 ` Reinette Chatre
2023-02-08 9:40 ` [PATCH 2/4] selftests/resctrl: Don't hard code divisor in MBM results Ilpo Järvinen
2023-02-14 0:59 ` Reinette Chatre [this message]
2023-02-14 10:00 ` Ilpo Järvinen
2023-02-14 17:01 ` Reinette Chatre
2023-02-08 9:40 ` [PATCH 3/4] selftests/resctrl: Change name from CBM_MASK_PATH to INFO_PATH Ilpo Järvinen
2023-02-08 14:04 ` Ilpo Järvinen
2023-02-14 0:59 ` Reinette Chatre
2023-02-08 9:40 ` [PATCH 4/4] selftests/resctrl: Use remount_resctrlfs() consistently with boolean Ilpo Järvinen
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=8ed0dcbd-86af-2658-95de-fdccffba7728@intel.com \
--to=reinette.chatre@intel.com \
--cc=fenghua.yu@intel.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
/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