kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yury Norov <ynorov@caviumnetworks.com>
To: Shih-Wei Li <shihwei@cs.columbia.edu>
Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu,
	christoffer.dall@linaro.org, marc.zyngier@arm.com,
	drjones@redhat.com, pbonzini@redhat.com
Subject: Re: [PATCH v3 0/2] Support micro operation measurement on arm64
Date: Thu, 18 Jan 2018 11:45:59 +0300	[thread overview]
Message-ID: <20180118084559.f22ffb7uz7zto73y@yury-thinkpad> (raw)
In-Reply-To: <1516225596-27071-1-git-send-email-shihwei@cs.columbia.edu>

On Wed, Jan 17, 2018 at 04:46:34PM -0500, Shih-Wei Li wrote:
> The patch provides support for quantifying the cost of micro level
> operations on arm64 hardware. The supported operations include hypercall,
> mmio accesses, EOI virtual interrupt, and IPI send. Measurements are
> currently obtained using timer counters. Further modifications in KVM
> will be required to support timestamping using cycle counters, as KVM
> now disables accesses to the PMU counters from the VM. The micro test
> is currently non-default and can be used as a standalone test.
> 
> We iterate each of the tests for millions of times and output their
> average, minimum and maximum cost in timer counts. Instruction barriers
> were used before and after taking timestamps to avoid out-of-order
> execution or pipelining from skewing our measurements.

Again. This is standard procedure to access the timer counter, not
some special precaution. And this sentence is erroneous because you 
flush pipeline only before. Please delete last sentence if you'll
send v4.

> We currently
> skip the test if its cost is smaller than a timer tick for 1000 times.
> 
> To improve precision in the measurements, one should consider pinning
> each VCPU to a specific physical CPU (PCPU) and ensure no other task
> could run on that PCPU to skew the results. This can be achieved by
> enabling QMP server in the QEMU command in unittest.cfg for micro test,
> allowing a client program to get the thread_id for each VCPU thread
> from the QMP server. Based on the information, the client program can
> then pin the corresponding VCPUs to dedicated PCPUs and isolate
> interrupts and tasks from those PCPUs.
> 
> The patch has been tested on arm64 hardware including AMD Seattle and
> ThunderX2, which has GICv2 and GICv3 respectively.

Could you please attach test outputs? I'm especially interested in
testing Christoffer's VHE series to compare your test with mine.

> Changes since v2:
>   - Rebased atop of 4a671159.
>   - Make microtest nondefault.
>   - Output the cost in microseconds.
>   - Added fail safe option to skip the test if the cost is consistently
>     smaller than a timer tick.
>   - Fixed nits from comments in v2.
> 
> Shih-Wei Li (2):
>   arm/arm64: add GICD_IIDR definition
>   arm64: add micro test
> 
>  arm/Makefile.common |   1 +
>  arm/micro-test.c    | 252 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  arm/unittests.cfg   |   7 ++
>  lib/arm/asm/gic.h   |   1 +
>  4 files changed, 261 insertions(+)
>  create mode 100644 arm/micro-test.c
> 
> -- 
> 1.9.1
> 

      parent reply	other threads:[~2018-01-18  8:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17 21:46 [PATCH v3 0/2] Support micro operation measurement on arm64 Shih-Wei Li
2018-01-17 21:46 ` [PATCH v3 1/2] arm/arm64: add GICD_IIDR definition Shih-Wei Li
2018-01-17 21:46 ` [PATCH v3 2/2] arm64: add micro test Shih-Wei Li
2018-01-18  9:30   ` Andrew Jones
2018-01-18 10:09   ` Yury Norov
2018-01-18 10:37     ` Andrew Jones
2018-01-18 11:39       ` Yury Norov
2018-01-19 21:57         ` Shih-Wei Li
2018-01-20 11:26           ` Yury Norov
2018-01-22  8:48           ` Andrew Jones
2018-01-23 18:48             ` Shih-Wei Li
2018-01-23 19:54               ` Andrew Jones
2018-01-24  8:17           ` Christoffer Dall
2018-01-24  8:30             ` Andrew Jones
2018-01-24  9:23               ` Christoffer Dall
2018-01-25  2:55                 ` Shih-Wei Li
2018-01-25  8:52                   ` Christoffer Dall
2018-01-25 13:45                     ` Shih-Wei Li
2018-01-18  8:45 ` Yury Norov [this message]

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=20180118084559.f22ffb7uz7zto73y@yury-thinkpad \
    --to=ynorov@caviumnetworks.com \
    --cc=christoffer.dall@linaro.org \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=marc.zyngier@arm.com \
    --cc=pbonzini@redhat.com \
    --cc=shihwei@cs.columbia.edu \
    /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;
as well as URLs for NNTP newsgroup(s).