linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/13] KVM: x86/mmu: Optimize clear dirty log
@ 2023-03-21 22:00 Sean Christopherson
  2023-03-21 22:00 ` [PATCH v4 01/13] KVM: x86/mmu: Add a helper function to check if an SPTE needs atomic write Sean Christopherson
                   ` (14 more replies)
  0 siblings, 15 replies; 18+ messages in thread
From: Sean Christopherson @ 2023-03-21 22:00 UTC (permalink / raw)
  To: Sean Christopherson, Paolo Bonzini
  Cc: kvm, linux-kernel, Vipin Sharma, David Matlack, Ben Gardon

This is a massaged version of Vipin's series to optimize clearing dirty
state in the TDP MMU.  It's basically the same as v3, just spread out over
more patches.  The only meaningful difference in the end is that
clear_dirty_gfn_range() also gets similar treatment in handling Dirty vs.
Writable logic.

Vipin, I'm still planning on applying this for 6.4, but the changes ended
up being a wee bit bigger than I'm comfortable making on the fly, thus the
formal posting.

v4:
- Split patches into more fine-grained chunks.
- Massage changelogs as needed.
- Collect reviews. [David]

v3:
- https://lore.kernel.org/all/20230211014626.3659152-1-vipinsh@google.com
- Tried to do better job at writing commit messages.
- Made kvm_tdp_mmu_clear_spte_bits() similar to the kvm_tdp_mmu_write_spte().
- clear_dirty_pt_masked() evaluates mask for the bit to be cleared outside the
  loop and use that for all of the SPTEs instead of calculating for each SPTE.
- Some naming changes based on the feedbacks.
- Split out the dead code clean from the optimization code.


v2: https://lore.kernel.org/lkml/20230203192822.106773-1-vipinsh@google.com/
- Clear dirty log and age gfn range does not go through
  handle_changed_spte, they handle their SPTE changes locally to improve
  their speed.
- Clear only specific bits atomically when updating SPTEs in clearing
  dirty log and aging gfn range functions.
- Removed tdp_mmu_set_spte_no_[acc_track|dirty_log] APIs.
- Converged all handle_changed_spte related functions to one place.

v1: https://lore.kernel.org/lkml/20230125213857.824959-1-vipinsh@google.com

Vipin Sharma (13):
  KVM: x86/mmu: Add a helper function to check if an SPTE needs atomic
    write
  KVM: x86/mmu: Use kvm_ad_enabled() to determine if TDP MMU SPTEs need
    wrprot
  KVM: x86/mmu: Consolidate Dirty vs. Writable clearing logic in TDP MMU
  KVM: x86/mmu: Atomically clear SPTE dirty state in the clear-dirty-log
    flow
  KVM: x86/mmu: Drop access tracking checks when clearing TDP MMU dirty
    bits
  KVM: x86/mmu: Bypass __handle_changed_spte() when clearing TDP MMU
    dirty bits
  KVM: x86/mmu: Remove "record_dirty_log" in __tdp_mmu_set_spte()
  KVM: x86/mmu: Clear only A-bit (if enabled) when aging TDP MMU SPTEs
  KVM: x86/mmu: Drop unnecessary dirty log checks when aging TDP MMU
    SPTEs
  KVM: x86/mmu: Bypass __handle_changed_spte() when aging TDP MMU SPTEs
  KVM: x86/mmu: Remove "record_acc_track" in __tdp_mmu_set_spte()
  KVM: x86/mmu: Remove handle_changed_spte_dirty_log()
  KVM: x86/mmu: Merge all handle_changed_pte*() functions

 arch/x86/kvm/mmu/tdp_iter.h |  48 +++++---
 arch/x86/kvm/mmu/tdp_mmu.c  | 215 ++++++++++++------------------------
 2 files changed, 106 insertions(+), 157 deletions(-)


base-commit: f3d90f901d18749dca096719540a075f59240051
-- 
2.40.0.rc2.332.ga46443480c-goog


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-06-26 21:37 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-21 22:00 [PATCH v4 00/13] KVM: x86/mmu: Optimize clear dirty log Sean Christopherson
2023-03-21 22:00 ` [PATCH v4 01/13] KVM: x86/mmu: Add a helper function to check if an SPTE needs atomic write Sean Christopherson
2023-03-21 22:00 ` [PATCH v4 02/13] KVM: x86/mmu: Use kvm_ad_enabled() to determine if TDP MMU SPTEs need wrprot Sean Christopherson
2023-03-21 22:00 ` [PATCH v4 03/13] KVM: x86/mmu: Consolidate Dirty vs. Writable clearing logic in TDP MMU Sean Christopherson
2023-03-21 22:00 ` [PATCH v4 04/13] KVM: x86/mmu: Atomically clear SPTE dirty state in the clear-dirty-log flow Sean Christopherson
2023-03-21 22:00 ` [PATCH v4 05/13] KVM: x86/mmu: Drop access tracking checks when clearing TDP MMU dirty bits Sean Christopherson
2023-03-21 22:00 ` [PATCH v4 06/13] KVM: x86/mmu: Bypass __handle_changed_spte() " Sean Christopherson
2023-06-25  7:44   ` Like Xu
2023-06-26 21:37     ` Sean Christopherson
2023-03-21 22:00 ` [PATCH v4 07/13] KVM: x86/mmu: Remove "record_dirty_log" in __tdp_mmu_set_spte() Sean Christopherson
2023-03-21 22:00 ` [PATCH v4 08/13] KVM: x86/mmu: Clear only A-bit (if enabled) when aging TDP MMU SPTEs Sean Christopherson
2023-03-21 22:00 ` [PATCH v4 09/13] KVM: x86/mmu: Drop unnecessary dirty log checks " Sean Christopherson
2023-03-21 22:00 ` [PATCH v4 10/13] KVM: x86/mmu: Bypass __handle_changed_spte() " Sean Christopherson
2023-03-21 22:00 ` [PATCH v4 11/13] KVM: x86/mmu: Remove "record_acc_track" in __tdp_mmu_set_spte() Sean Christopherson
2023-03-21 22:00 ` [PATCH v4 12/13] KVM: x86/mmu: Remove handle_changed_spte_dirty_log() Sean Christopherson
2023-03-21 22:00 ` [PATCH v4 13/13] KVM: x86/mmu: Merge all handle_changed_pte*() functions Sean Christopherson
2023-03-31  0:13 ` [PATCH v4 00/13] KVM: x86/mmu: Optimize clear dirty log Vipin Sharma
2023-04-04 23:44 ` Sean Christopherson

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).