From: Alexandru Elisei <alexandru.elisei@arm.com>
To: heqiong <heqiong1557@phytium.com.cn>
Cc: andrew.jones@linux.dev, kvm@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH 1/1] arm64: microbench: Improve measurement accuracy of tests
Date: Mon, 20 Nov 2023 17:25:55 +0000 [thread overview]
Message-ID: <ZVuWo+07reF55eXj@arm.com> (raw)
In-Reply-To: <20231116045355.2045483-1-heqiong1557@phytium.com.cn>
Hi,
On Thu, Nov 16, 2023 at 12:53:55PM +0800, heqiong wrote:
> Reducing the impact of the cntvct_el0 register and isb() operation
> on microbenchmark test results to improve testing accuracy and reduce
> latency in test results.
Sorry, lost track of which version is the latest - that's why patch version
numbers are really useful!
Everything look alright to me:
Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>
Thanks,
Alex
>
> Signed-off-by: heqiong <heqiong1557@phytium.com.cn>
> ---
> arm/micro-bench.c | 19 +++++++++++--------
> 1 file changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/arm/micro-bench.c b/arm/micro-bench.c
> index fbe59d03..22408955 100644
> --- a/arm/micro-bench.c
> +++ b/arm/micro-bench.c
> @@ -24,7 +24,6 @@
> #include <asm/gic-v3-its.h>
> #include <asm/timer.h>
>
> -#define NS_5_SECONDS (5 * 1000 * 1000 * 1000UL)
> #define QEMU_MMIO_ADDR 0x0a000008
>
> static u32 cntfrq;
> @@ -346,17 +345,21 @@ static void loop_test(struct exit_test *test)
> }
> }
>
> - while (ntimes < test->times && total_ns.ns < NS_5_SECONDS) {
> - isb();
> - start = read_sysreg(cntvct_el0);
> + dsb(ish);
> + isb();
> + start = read_sysreg(cntvct_el0);
> + isb();
> + while (ntimes < test->times) {
> test->exec();
> - isb();
> - end = read_sysreg(cntvct_el0);
>
> ntimes++;
> - total_ticks += (end - start);
> - ticks_to_ns_time(total_ticks, &total_ns);
> }
> + dsb(ish);
> + isb();
> + end = read_sysreg(cntvct_el0);
> +
> + total_ticks = end - start;
> + ticks_to_ns_time(total_ticks, &total_ns);
>
> if (test->post) {
> test->post(ntimes, &total_ticks);
> --
> 2.39.3
>
next prev parent reply other threads:[~2023-11-20 17:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-07 6:40 [kvm-unit-tests 1/1] arm64: microbench: Move the read of the count register and the ISB operation out of the while loop heqiong
2023-11-07 8:40 ` Andrew Jones
2023-11-16 4:53 ` [kvm-unit-tests PATCH 1/1] arm64: microbench: Improve measurement accuracy of tests heqiong
2023-11-20 8:35 ` Andrew Jones
2023-11-20 17:25 ` Alexandru Elisei [this message]
2023-11-21 11:45 ` Andrew Jones
2023-11-07 9:07 ` [kvm-unit-tests 1/1] arm64: microbench: Move the read of the count register and the ISB operation out of the while loop Alexandru Elisei
2023-11-07 9:51 ` [kvm-unit-tests PATCH " heqiong
2023-11-07 12:49 ` Alexandru Elisei
2023-11-07 13:53 ` Zenghui Yu
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=ZVuWo+07reF55eXj@arm.com \
--to=alexandru.elisei@arm.com \
--cc=andrew.jones@linux.dev \
--cc=heqiong1557@phytium.com.cn \
--cc=kvm@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.