linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Gardon <bgardon@google.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	linux-kselftest@vger.kernel.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Cannon Matthews <cannonmatthews@google.com>,
	Peter Xu <peterx@redhat.com>, Andrew Jones <drjones@redhat.com>
Subject: Re: [PATCH v3 0/8] Create a userfaultfd demand paging test
Date: Mon, 6 Jan 2020 14:46:42 -0800	[thread overview]
Message-ID: <CANgfPd-vDhHeBxCeJNfT7m75KYvGZTi+wHTAuZKO3ZchxMsBxw@mail.gmail.com> (raw)
In-Reply-To: <20191216213901.106941-1-bgardon@google.com>

If anyone has a chance to re-review this test patch series I'd be
grateful. I responded to most of the feedback I received in the first
series, and believe this test will be a useful performance benchmark
for future development.

On Mon, Dec 16, 2019 at 1:39 PM Ben Gardon <bgardon@google.com> wrote:
>
> When handling page faults for many vCPUs during demand paging, KVM's MMU
> lock becomes highly contended. This series creates a test with a naive
> userfaultfd based demand paging implementation to demonstrate that
> contention. This test serves both as a functional test of userfaultfd
> and a microbenchmark of demand paging performance with a variable number
> of vCPUs and memory per vCPU.
>
> The test creates N userfaultfd threads, N vCPUs, and a region of memory
> with M pages per vCPU. The N userfaultfd polling threads are each set up
> to serve faults on a region of memory corresponding to one of the vCPUs.
> Each of the vCPUs is then started, and touches each page of its disjoint
> memory region, sequentially. In response to faults, the userfaultfd
> threads copy a static buffer into the guest's memory. This creates a
> worst case for MMU lock contention as we have removed most of the
> contention between the userfaultfd threads and there is no time required
> to fetch the contents of guest memory.
>
> This test was run successfully on Intel Haswell, Broadwell, and
> Cascadelake hosts with a variety of vCPU counts and memory sizes.
>
> This test was adapted from the dirty_log_test.
>
> The series can also be viewed in Gerrit here:
> https://linux-review.googlesource.com/c/virt/kvm/kvm/+/1464
> (Thanks to Dmitry Vyukov <dvyukov@google.com> for setting up the Gerrit
> instance)
>
> Ben Gardon (9):
>   KVM: selftests: Create a demand paging test
>   KVM: selftests: Add demand paging content to the demand paging test
>   KVM: selftests: Add memory size parameter to the demand paging test
>   KVM: selftests: Pass args to vCPU instead of using globals
>   KVM: selftests: Support multiple vCPUs in demand paging test
>   KVM: selftests: Time guest demand paging
>   KVM: selftests: Add parameter to _vm_create for memslot 0 base paddr
>   KVM: selftests: Support large VMs in demand paging test
>   Add static flag
>
>  tools/testing/selftests/kvm/.gitignore        |   1 +
>  tools/testing/selftests/kvm/Makefile          |   4 +-
>  .../selftests/kvm/demand_paging_test.c        | 610 ++++++++++++++++++
>  tools/testing/selftests/kvm/dirty_log_test.c  |   2 +-
>  .../testing/selftests/kvm/include/kvm_util.h  |   3 +-
>  tools/testing/selftests/kvm/lib/kvm_util.c    |   7 +-
>  6 files changed, 621 insertions(+), 6 deletions(-)
>  create mode 100644 tools/testing/selftests/kvm/demand_paging_test.c
>
> --
> 2.23.0.444.g18eeb5a265-goog
>

      parent reply	other threads:[~2020-01-06 22:46 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-16 21:38 [PATCH v3 0/8] Create a userfaultfd demand paging test Ben Gardon
2019-12-16 21:38 ` [PATCH v3 1/8] KVM: selftests: Create a " Ben Gardon
2020-01-07 14:33   ` Peter Xu
2020-01-07 14:56     ` Andrew Jones
2020-01-07 18:41       ` Ben Gardon
2020-01-08 13:45         ` Andrew Jones
2019-12-16 21:38 ` [PATCH v3 2/8] KVM: selftests: Add demand paging content to the " Ben Gardon
2020-01-07 16:00   ` Peter Xu
2020-01-07 21:13     ` Ben Gardon
2019-12-16 21:38 ` [PATCH v3 3/8] KVM: selftests: Add configurable demand paging delay Ben Gardon
2020-01-07 16:04   ` Peter Xu
2019-12-16 21:38 ` [PATCH v3 4/8] KVM: selftests: Add memory size parameter to the demand paging test Ben Gardon
2020-01-07 15:02   ` Andrew Jones
2020-01-07 21:18     ` Ben Gardon
2019-12-16 21:38 ` [PATCH v3 5/8] KVM: selftests: Pass args to vCPU instead of using globals Ben Gardon
2020-01-07 15:23   ` Andrew Jones
2020-01-07 18:26     ` Ben Gardon
2020-01-08 13:59       ` Andrew Jones
2019-12-16 21:38 ` [PATCH v3 6/8] KVM: selftests: Support multiple vCPUs in demand paging test Ben Gardon
2020-01-07 15:27   ` Andrew Jones
2019-12-16 21:39 ` [PATCH v3 7/8] KVM: selftests: Time guest demand paging Ben Gardon
2019-12-16 21:39 ` [PATCH v3 8/8] KVM: selftests: Move large memslots above KVM internal memslots in _vm_create Ben Gardon
2020-01-07 15:42   ` Andrew Jones
2020-01-07 21:20     ` Ben Gardon
2020-01-08 14:07       ` Andrew Jones
2020-01-06 22:46 ` Ben Gardon [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=CANgfPd-vDhHeBxCeJNfT7m75KYvGZTi+wHTAuZKO3ZchxMsBxw@mail.gmail.com \
    --to=bgardon@google.com \
    --cc=cannonmatthews@google.com \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.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;
as well as URLs for NNTP newsgroup(s).