kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: David Matlack <dmatlack@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH v2 0/6] KVM: x86/mmu: Optimize TDP MMU huge page recovery during disable-dirty-log
Date: Thu, 31 Oct 2024 13:00:22 -0700	[thread overview]
Message-ID: <ZyPh1nARL4vThB4J@google.com> (raw)
In-Reply-To: <20240823235648.3236880-1-dmatlack@google.com>

On Fri, Aug 23, 2024, David Matlack wrote:
> Rework the TDP MMU disable-dirty-log path to batch TLB flushes and
> recover huge page mappings, rather than zapping and flushing for every
> potential huge page mapping.
> 
> With this series, dirty_log_perf_test shows a decrease in the time it takes to
> disable dirty logging, as well as a decrease in the number of vCPU faults:
> 
>  $ ./dirty_log_perf_test -s anonymous_hugetlb_2mb -v 64 -e -b 4g
> 
>  Before: Disabling dirty logging time: 14.334453428s (131072 flushes)
>  After:  Disabling dirty logging time: 4.794969689s  (76 flushes)
> 
>  Before: 393,599      kvm:kvm_page_fault
>  After:  262,575      kvm:kvm_page_fault
> 
> v2:
>  - Use a separate iterator to walk down to child SPTEs during huge page
>    recovery [Sean]
>  - Return SHADOW_NONPRESENT_VALUE in error conditions in
>    make_huge_spte() [Vipin][off-list]
> 
> v1: https://lore.kernel.org/kvm/20240805233114.4060019-8-dmatlack@google.com/
> 
> David Matlack (6):
>   KVM: x86/mmu: Drop @max_level from kvm_mmu_max_mapping_level()
>   KVM: x86/mmu: Batch TLB flushes when zapping collapsible TDP MMU SPTEs
>   KVM: x86/mmu: Refactor TDP MMU iter need resched check
>   KVM: x86/mmu: Recover TDP MMU huge page mappings in-place instead of
>     zapping
>   KVM: x86/mmu: Rename make_huge_page_split_spte() to make_small_spte()
>   KVM: x86/mmu: WARN if huge page recovery triggered during dirty
>     logging
> 
>  arch/x86/include/asm/kvm_host.h |   4 +-
>  arch/x86/kvm/mmu/mmu.c          |  16 ++--
>  arch/x86/kvm/mmu/mmu_internal.h |   3 +-
>  arch/x86/kvm/mmu/spte.c         |  43 +++++++++--
>  arch/x86/kvm/mmu/spte.h         |   5 +-
>  arch/x86/kvm/mmu/tdp_mmu.c      | 129 +++++++++++++++++---------------
>  arch/x86/kvm/mmu/tdp_mmu.h      |   4 +-
>  arch/x86/kvm/x86.c              |  18 ++---
>  8 files changed, 128 insertions(+), 94 deletions(-)

FYI, these are sitting in kvm-x86 mmu, but will be rebased next week, at which
point I'll send the "official" thank yous.

[1/8] KVM: x86/mmu: Drop @max_level from kvm_mmu_max_mapping_level()
      https://github.com/kvm-x86/linux/commit/8ccd51cb5911
[2/8] KVM: x86/mmu: Batch TLB flushes when zapping collapsible TDP MMU SPTEs
      https://github.com/kvm-x86/linux/commit/35ef80eb29ab
[3/8] KVM: x86/mmu: Check yielded_gfn for forward progress iff resched is needed
      https://github.com/kvm-x86/linux/commit/d400ce271d9c
[4/8] KVM: x86/mmu: Demote the WARN on yielded in xxx_cond_resched() to KVM_MMU_WARN_ON
      https://github.com/kvm-x86/linux/commit/012a5c17cba4
[5/8] KVM: x86/mmu: Refactor TDP MMU iter need resched check
      https://github.com/kvm-x86/linux/commit/cb059b9e2432
[6/8] KVM: x86/mmu: Recover TDP MMU huge page mappings in-place instead of zapping
      https://github.com/kvm-x86/linux/commit/13237fb40c74
[7/8] KVM: x86/mmu: Rename make_huge_page_split_spte() to make_small_spte()
      https://github.com/kvm-x86/linux/commit/1d2a6d0b6438
[8/8] KVM: x86/mmu: WARN if huge page recovery triggered during dirty logging
      https://github.com/kvm-x86/linux/commit/ed5ca61d995f

  parent reply	other threads:[~2024-10-31 20:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-23 23:56 [PATCH v2 0/6] KVM: x86/mmu: Optimize TDP MMU huge page recovery during disable-dirty-log David Matlack
2024-08-23 23:56 ` [PATCH v2 1/6] KVM: x86/mmu: Drop @max_level from kvm_mmu_max_mapping_level() David Matlack
2024-08-23 23:56 ` [PATCH v2 2/6] KVM: x86/mmu: Batch TLB flushes when zapping collapsible TDP MMU SPTEs David Matlack
2024-08-23 23:56 ` [PATCH v2 3/6] KVM: x86/mmu: Refactor TDP MMU iter need resched check David Matlack
2024-10-31  0:04   ` Sean Christopherson
2024-08-23 23:56 ` [PATCH v2 4/6] KVM: x86/mmu: Recover TDP MMU huge page mappings in-place instead of zapping David Matlack
2024-10-09 16:23   ` Vipin Sharma
2024-10-09 17:35     ` Sean Christopherson
2024-10-09 20:21       ` Vipin Sharma
2024-10-30 23:42         ` Sean Christopherson
2024-11-01 20:37           ` Vipin Sharma
2024-11-04 22:39             ` Sean Christopherson
2024-08-23 23:56 ` [PATCH v2 5/6] KVM: x86/mmu: Rename make_huge_page_split_spte() to make_small_spte() David Matlack
2024-08-23 23:56 ` [PATCH v2 6/6] KVM: x86/mmu: WARN if huge page recovery triggered during dirty logging David Matlack
2024-10-31 20:00 ` Sean Christopherson [this message]
2024-11-05  5:56 ` [PATCH v2 0/6] KVM: x86/mmu: Optimize TDP MMU huge page recovery during disable-dirty-log Sean Christopherson

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=ZyPh1nARL4vThB4J@google.com \
    --to=seanjc@google.com \
    --cc=dmatlack@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@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).