From: Reinette Chatre <reinette.chatre@intel.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.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 4/6] selftests/resctrl: Use cache size to determine "fill_buf" buffer size
Date: Fri, 30 Aug 2024 09:00:44 -0700 [thread overview]
Message-ID: <094411c1-9ef9-4030-9c2a-35c78b4da00c@intel.com> (raw)
In-Reply-To: <4434b263-9049-3d44-6b41-a840b39205cd@linux.intel.com>
Hi Ilpo,
On 8/30/24 4:25 AM, Ilpo Järvinen wrote:
> On Thu, 29 Aug 2024, Reinette Chatre wrote:
>
>> By default the MBM and MBA tests use the "fill_buf" benchmark to
>> read from a buffer with the goal to measure the memory bandwidth
>> generated by this buffer access.
>>
>> Care should be taken when sizing the buffer used by the "fill_buf"
>> benchmark. If the buffer is small enough to fit in the cache then
>> it cannot be expected that the benchmark will generate much memory
>> bandwidth. For example, on a system with 320MB L3 cache the existing
>> hardcoded default of 250MB is insufficient.
>>
>> Use the measured cache size to determine a buffer size that can be
>> expected to trigger memory access while keeping the existing default
>> as minimum that has been appropriate for testing so far.
>>
>> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
>> ---
>> tools/testing/selftests/resctrl/mba_test.c | 8 +++++++-
>> tools/testing/selftests/resctrl/mbm_test.c | 8 +++++++-
>> 2 files changed, 14 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/testing/selftests/resctrl/mba_test.c b/tools/testing/selftests/resctrl/mba_test.c
>> index 8ad433495f61..cad473b81a64 100644
>> --- a/tools/testing/selftests/resctrl/mba_test.c
>> +++ b/tools/testing/selftests/resctrl/mba_test.c
>> @@ -170,11 +170,17 @@ static int mba_run_test(const struct resctrl_test *test, const struct user_param
>> .setup = mba_setup,
>> .measure = mba_measure,
>> };
>> + unsigned long cache_total_size = 0;
>> int ret;
>>
>> remove(RESULT_FILE_NAME);
>>
>> - param.fill_buf.buf_size = DEFAULT_SPAN;
>> + ret = get_cache_size(uparams->cpu, "L3", &cache_total_size);
>> + if (ret)
>> + return ret;
>> +
>> + param.fill_buf.buf_size = cache_total_size > DEFAULT_SPAN ?
>> + cache_total_size * 2 : DEFAULT_SPAN;
>
> Should the check leave a bit of safeguard so that the buf_size is at
> least 2x (or x1.25 or some other factor)?
>
> In here buf_size immediate jumps from 1x -> 2x when cache_total_size goes
> from DEFAULT_SPAN to DEFAULT_SPAN+1 (obviously L3 size won't be odd like
> that but I think you get my point).
Good catch. Will fix.
>
> Also, user might want to override this as mentioned in my reply to the
> previous patch.
>
ack.
Reinette
next prev parent reply other threads:[~2024-08-30 16:00 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-29 22:52 [PATCH 0/6] selftests/resctrl: Support diverse platforms with MBM and MBA tests Reinette Chatre
2024-08-29 22:52 ` [PATCH 1/6] selftests/resctrl: Fix sparse warnings Reinette Chatre
2024-08-30 10:29 ` Ilpo Järvinen
2024-08-29 22:52 ` [PATCH 2/6] selftests/resctrl: Ensure measurements skip initialization of default benchmark Reinette Chatre
2024-08-30 10:56 ` Ilpo Järvinen
2024-08-30 16:00 ` Reinette Chatre
2024-09-04 11:57 ` Ilpo Järvinen
2024-09-04 21:15 ` Reinette Chatre
2024-09-05 12:10 ` Ilpo Järvinen
2024-09-05 18:08 ` Reinette Chatre
2024-09-06 10:00 ` Ilpo Järvinen
2024-09-07 0:05 ` Reinette Chatre
2024-09-09 12:52 ` Ilpo Järvinen
2024-08-29 22:52 ` [PATCH 3/6] selftests/resctrl: Simplify benchmark parameter passing Reinette Chatre
2024-08-30 11:13 ` Ilpo Järvinen
2024-08-30 16:01 ` Reinette Chatre
2024-08-29 22:52 ` [PATCH 4/6] selftests/resctrl: Use cache size to determine "fill_buf" buffer size Reinette Chatre
2024-08-30 11:25 ` Ilpo Järvinen
2024-08-30 16:00 ` Reinette Chatre [this message]
2024-08-29 22:52 ` [PATCH 5/6] selftests/resctrl: Do not compare performance counters and resctrl at low bandwidth Reinette Chatre
2024-08-30 11:42 ` Ilpo Järvinen
2024-08-30 16:00 ` Reinette Chatre
2024-09-04 11:43 ` Ilpo Järvinen
2024-09-04 21:15 ` Reinette Chatre
2024-09-05 11:45 ` Ilpo Järvinen
2024-09-05 18:08 ` Reinette Chatre
2024-09-06 8:44 ` Ilpo Järvinen
2024-09-07 0:05 ` Reinette Chatre
2024-09-09 8:13 ` Ilpo Järvinen
2024-08-29 22:52 ` [PATCH 6/6] selftests/resctrl: Keep results from first test run 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=094411c1-9ef9-4030-9c2a-35c78b4da00c@intel.com \
--to=reinette.chatre@intel.com \
--cc=babu.moger@amd.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=maciej.wieczor-retman@intel.com \
--cc=peternewman@google.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