All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] KVM: Optimize MMU notifier's THP page invalidation -v3
  2012-06-21  8:48 ` Takuya Yoshikawa
@ 2012-06-28  1:57 ` Takuya Yoshikawa
  -1 siblings, 0 replies; 52+ messages in thread
From: Takuya Yoshikawa @ 2012-06-28  1:57 UTC (permalink / raw)
  To: avi, mtosatti
  Cc: agraf, paulus, aarcange, kvm, kvm-ppc, linux-kernel, takuya.yoshikawa

Updated patch 3 and 6 so that unmap handler be called with exactly same
rmap arguments as before, even if kvm_handle_hva_range() is called with
unaligned [start, end).

Please see the comments I added there.

	Takuya


Takuya Yoshikawa (6):
  KVM: MMU: Use __gfn_to_rmap() to clean up kvm_handle_hva()
  KVM: Introduce hva_to_gfn_memslot() for kvm_handle_hva()
  KVM: MMU: Make kvm_handle_hva() handle range of addresses
  KVM: Introduce kvm_unmap_hva_range() for kvm_mmu_notifier_invalidate_range_start()
  KVM: Separate rmap_pde from kvm_lpage_info->write_count
  KVM: MMU: Avoid handling same rmap_pde in kvm_handle_hva_range()


 arch/powerpc/include/asm/kvm_host.h |    2 +
 arch/powerpc/kvm/book3s_64_mmu_hv.c |   47 +++++++++++++++----
 arch/x86/include/asm/kvm_host.h     |    3 +-
 arch/x86/kvm/mmu.c                  |   83 +++++++++++++++++++++++------------
 arch/x86/kvm/x86.c                  |   11 +++++
 include/linux/kvm_host.h            |    8 +++
 virt/kvm/kvm_main.c                 |    3 +-
 7 files changed, 116 insertions(+), 41 deletions(-)


>From v2:

I added further optimization based on Avi's advice and my rmap_pde work.
 - patch [5-6]

The new test result was impressively good, see below, and THP page
invalidation was more than 5 times faster on my x86 machine.

Before:
  ...
  19.852 us  |  __mmu_notifier_invalidate_range_start();
  28.033 us  |  __mmu_notifier_invalidate_range_start();
  19.066 us  |  __mmu_notifier_invalidate_range_start();
  44.715 us  |  __mmu_notifier_invalidate_range_start();
  31.613 us  |  __mmu_notifier_invalidate_range_start();
  20.659 us  |  __mmu_notifier_invalidate_range_start();
  19.979 us  |  __mmu_notifier_invalidate_range_start();
  20.416 us  |  __mmu_notifier_invalidate_range_start();
  20.632 us  |  __mmu_notifier_invalidate_range_start();
  22.316 us  |  __mmu_notifier_invalidate_range_start();
  ...

After:
  ...
  4.089 us   |  __mmu_notifier_invalidate_range_start();
  4.096 us   |  __mmu_notifier_invalidate_range_start();
  3.560 us   |  __mmu_notifier_invalidate_range_start();
  3.376 us   |  __mmu_notifier_invalidate_range_start();
  3.772 us   |  __mmu_notifier_invalidate_range_start();
  3.353 us   |  __mmu_notifier_invalidate_range_start();
  3.332 us   |  __mmu_notifier_invalidate_range_start();
  3.332 us   |  __mmu_notifier_invalidate_range_start();
  3.332 us   |  __mmu_notifier_invalidate_range_start();
  3.337 us   |  __mmu_notifier_invalidate_range_start();
  ...
-- 
1.7.5.4


^ permalink raw reply	[flat|nested] 52+ messages in thread
* [PATCH 0/6] KVM: Optimize MMU notifier's THP page invalidation -v2
@ 2012-06-21  8:48 ` Takuya Yoshikawa
  0 siblings, 0 replies; 52+ messages in thread
From: Takuya Yoshikawa @ 2012-06-21  8:48 UTC (permalink / raw)
  To: avi, mtosatti
  Cc: agraf, paulus, aarcange, kvm, kvm-ppc, linux-kernel, takuya.yoshikawa

I added further optimization based on Avi's advice and my rmap_pde work.
 - patch [5-6]

The new test result was impressively good, see below, and THP page
invalidation was more than 5 times faster on my x86 machine.

I also noticed that GUI's responsiveness on the host during swapping the
guest's memory improved a lot.

Before:
  ...
  19.852 us  |  __mmu_notifier_invalidate_range_start();
  28.033 us  |  __mmu_notifier_invalidate_range_start();
  19.066 us  |  __mmu_notifier_invalidate_range_start();
  44.715 us  |  __mmu_notifier_invalidate_range_start();
  31.613 us  |  __mmu_notifier_invalidate_range_start();
  20.659 us  |  __mmu_notifier_invalidate_range_start();
  19.979 us  |  __mmu_notifier_invalidate_range_start();
  20.416 us  |  __mmu_notifier_invalidate_range_start();
  20.632 us  |  __mmu_notifier_invalidate_range_start();
  22.316 us  |  __mmu_notifier_invalidate_range_start();
  ...

After:
  ...
  4.089 us   |  __mmu_notifier_invalidate_range_start();
  4.096 us   |  __mmu_notifier_invalidate_range_start();
  3.560 us   |  __mmu_notifier_invalidate_range_start();
  3.376 us   |  __mmu_notifier_invalidate_range_start();
  3.772 us   |  __mmu_notifier_invalidate_range_start();
  3.353 us   |  __mmu_notifier_invalidate_range_start();
  3.332 us   |  __mmu_notifier_invalidate_range_start();
  3.332 us   |  __mmu_notifier_invalidate_range_start();
  3.332 us   |  __mmu_notifier_invalidate_range_start();
  3.337 us   |  __mmu_notifier_invalidate_range_start();
  ...

Takuya Yoshikawa (6):
  KVM: MMU: Use __gfn_to_rmap() to clean up kvm_handle_hva()
  KVM: Introduce hva_to_gfn_memslot() for kvm_handle_hva()
  KVM: MMU: Make kvm_handle_hva() handle range of addresses
  KVM: Introduce kvm_unmap_hva_range() for kvm_mmu_notifier_invalidate_range_start()
  KVM: Separate rmap_pde from kvm_lpage_info->write_count
  KVM: MMU: Avoid handling same rmap_pde in kvm_handle_hva_range()

 arch/powerpc/include/asm/kvm_host.h |    2 +
 arch/powerpc/kvm/book3s_64_mmu_hv.c |   42 +++++++++++++++-----
 arch/x86/include/asm/kvm_host.h     |    3 +-
 arch/x86/kvm/mmu.c                  |   72 +++++++++++++++++++++++------------
 arch/x86/kvm/x86.c                  |   13 ++++++-
 include/linux/kvm_host.h            |    8 ++++
 virt/kvm/kvm_main.c                 |    3 +-
 7 files changed, 104 insertions(+), 39 deletions(-)

-- 
1.7.5.4


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

end of thread, other threads:[~2012-07-02  2:22 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-28  1:57 [PATCH 0/6] KVM: Optimize MMU notifier's THP page invalidation -v3 Takuya Yoshikawa
2012-06-28  1:57 ` Takuya Yoshikawa
2012-06-28  1:58 ` [PATCH 1/6] KVM: MMU: Use __gfn_to_rmap() to clean up kvm_handle_hva() Takuya Yoshikawa
2012-06-28  1:58   ` Takuya Yoshikawa
2012-06-28  1:59 ` [PATCH 2/6] KVM: Introduce hva_to_gfn_memslot() for kvm_handle_hva() Takuya Yoshikawa
2012-06-28  1:59   ` Takuya Yoshikawa
2012-06-28  2:00 ` [PATCH 3/6] KVM: MMU: Make kvm_handle_hva() handle range of addresses Takuya Yoshikawa
2012-06-28  2:00   ` Takuya Yoshikawa
2012-06-28  2:00 ` [PATCH 4/6] KVM: Introduce kvm_unmap_hva_range() for kvm_mmu_notifier_invalidate_range_start() Takuya Yoshikawa
2012-06-28  2:00   ` Takuya Yoshikawa
2012-06-28  2:01 ` [PATCH 5/6] KVM: Separate rmap_pde from kvm_lpage_info->write_count Takuya Yoshikawa
2012-06-28  2:01   ` Takuya Yoshikawa
2012-06-28  3:12   ` Xiao Guangrong
2012-06-28  3:12     ` Xiao Guangrong
2012-06-28  3:45     ` Takuya Yoshikawa
2012-06-28  3:45       ` Takuya Yoshikawa
2012-06-28 17:39       ` Avi Kivity
2012-06-28 17:39         ` Avi Kivity
2012-06-29  1:44         ` Takuya Yoshikawa
2012-06-29  1:44           ` Takuya Yoshikawa
2012-07-02  2:22         ` Xiao Guangrong
2012-07-02  2:22           ` Xiao Guangrong
2012-06-28  2:02 ` [PATCH 6/6] KVM: MMU: Avoid handling same rmap_pde in kvm_handle_hva_range() Takuya Yoshikawa
2012-06-28  2:02   ` Takuya Yoshikawa
2012-06-28 17:53   ` Avi Kivity
2012-06-28 17:53     ` Avi Kivity
2012-06-29  1:46     ` Takuya Yoshikawa
2012-06-29  1:46       ` Takuya Yoshikawa
2012-07-01  7:41       ` Avi Kivity
2012-07-01  7:41         ` Avi Kivity
2012-07-01 13:18         ` Takuya Yoshikawa
2012-07-01 13:18           ` Takuya Yoshikawa
2012-07-01 13:31           ` Avi Kivity
2012-07-01 13:31             ` Avi Kivity
  -- strict thread matches above, loose matches on Subject: below --
2012-06-21  8:48 [PATCH 0/6] KVM: Optimize MMU notifier's THP page invalidation -v2 Takuya Yoshikawa
2012-06-21  8:48 ` Takuya Yoshikawa
2012-06-21  8:49 ` [PATCH 1/6] KVM: MMU: Use __gfn_to_rmap() to clean up kvm_handle_hva() Takuya Yoshikawa
2012-06-21  8:49   ` Takuya Yoshikawa
2012-06-21  8:49 ` [PATCH 2/6] KVM: Introduce hva_to_gfn_memslot() for kvm_handle_hva() Takuya Yoshikawa
2012-06-21  8:49   ` Takuya Yoshikawa
2012-06-21  8:50 ` [PATCH 3/6] KVM: MMU: Make kvm_handle_hva() handle range of addresses Takuya Yoshikawa
2012-06-21  8:50   ` Takuya Yoshikawa
2012-06-21  8:51 ` [PATCH 4/6] KVM: Introduce kvm_unmap_hva_range() for kvm_mmu_notifier_invalidate_range_start() Takuya Yoshikawa
2012-06-21  8:51   ` Takuya Yoshikawa
2012-06-21  8:51 ` [PATCH 5/6] KVM: Separate rmap_pde from kvm_lpage_info->write_count Takuya Yoshikawa
2012-06-21  8:51   ` Takuya Yoshikawa
2012-06-21  8:52 ` [PATCH 6/6] KVM: MMU: Avoid handling same rmap_pde in kvm_handle_hva_range() Takuya Yoshikawa
2012-06-21  8:52   ` Takuya Yoshikawa
2012-06-22 14:33   ` Takuya Yoshikawa
2012-06-22 14:33     ` Takuya Yoshikawa
2012-06-21 12:51 ` [PATCH 0/6] KVM: Optimize MMU notifier's THP page invalidation -v2 Alexander Graf
2012-06-21 12:51   ` Alexander Graf

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.