Skip to content

Hyper-V: paravirtualized remote TLB flushing and hypercall improvements

Vitaly Kuznetsov kvm lkml xen-devel 10 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v10 Latest9 patches 47 repliesIn review
  2. v910 patches 2 repliesSuperseded
  3. v810 patches 13 repliesSuperseded
Earlier versions · 7
VersionPostedPatchesRepliesStatus
v710 patches1 replySuperseded
v610 patches0 repliesSuperseded
v510 patches18 repliesSuperseded
v410 patches11 repliesSuperseded
v310 patches11 repliesSuperseded
v210 patches1 replySuperseded
v17 patches18 repliesSuperseded

Changes in v10 from the cover letter

- Rebase to 4.13-rc3.
- Drop PATCH1 as it was already taken by Greg to char-misc tree. There're no functional dependencies on this patch so the series can go through a different tree (and it actually belongs to x86 if I got Ingo's comment right).
- Add in missing void return type in PATCH1 [Colin King, Ingo Molnar, Greg KH]
- A few minor fixes in what is now PATCH7: add pr_fmt, tiny style fix in hyperv_flush_tlb_others() [Andy Shevchenko]
- Fix "error: implicit declaration of function 'virt_to_phys'" in PATCH2 reported by kbuild test robot (#include <asm/io.h>)
- Add Steven's 'Reviewed-by:' to PATCH9.

Patches in v10 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9x86/hyper-v: include hyperv/ only when CONFIG_HYPERV is setarch/x86/Kbuild arch/x86/include/asm/mshyperv.h+7 -20 replies
2/9x86/hyper-v: make hv_do_hypercall() inlinearch/x86/hyperv/hv_init.c arch/x86/include/asm/mshyperv.h drivers/hv/connection.c +1 more+47 -500 replies
3/9x86/hyper-v: fast hypercall implementationarch/x86/include/asm/mshyperv.h+34 -00 replies
4/9hyper-v: use fast hypercall for HVCALL_SIGNAL_EVENTdrivers/hv/channel_mgmt.c drivers/hv/connection.c include/linux/hyperv.h+4 -260 replies
5/9x86/hyper-v: implement rep hypercallsarch/x86/include/asm/mshyperv.h+39 -00 replies
6/9hyper-v: globalize vp_indexarch/x86/hyperv/hv_init.c arch/x86/include/asm/mshyperv.h drivers/hv/channel_mgmt.c +6 more+65 -950 replies
7/9x86/hyper-v: use hypercall for remote TLB flusharch/x86/hyperv/Makefile arch/x86/hyperv/hv_init.c arch/x86/hyperv/mmu.c +3 more+152 -133 replies
8/9x86/hyper-v: support extended CPU ranges for TLB flush hypercallsarch/x86/hyperv/mmu.c arch/x86/include/uapi/asm/hyperv.h+140 -30 replies
9/9tracing/hyper-v: trace hyperv_mmu_flush_tlb_others()MAINTAINERS arch/x86/hyperv/mmu.c arch/x86/include/asm/trace/hyperv.h+48 -00 replies

Reviews trailers per patch

All 9 patches have a Reviewed-by or Acked-by.

PatchAndy ShevchenkoStephen HemmingerSteven Rostedt (VMware)
1/9R-b R-b
2/9R-b R-b
3/9R-b R-b
4/9R-b R-b
5/9R-b R-b
6/9R-b R-b
7/9R-b R-b
8/9R-b R-b
9/9R-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v10 thread

Cover letter [PATCH v10 0/9] Hyper-V: paravirtualized remote TLB flushing and hypercall improvements

Changes since v9:
- Rebase to 4.13-rc3.
- Drop PATCH1 as it was already taken by Greg to char-misc tree. There're no functional dependencies on this patch so the series can go through a different tree (and it actually belongs to x86 if I got Ingo's comment right).
- Add in missing void return type in PATCH1 [Colin King, Ingo Molnar, Greg KH]
- A few minor fixes in what is now PATCH7: add pr_fmt, tiny style fix in hyperv_flush_tlb_others() [Andy Shevchenko]
- Fix "error: implicit declaration of function 'virt_to_phys'" in PATCH2 reported by kbuild test robot (#include <asm/io.h>)
- Add Steven's 'Reviewed-by:' to PATCH9.

Original description:

Hyper-V supports hypercalls for doing local and remote TLB flushing and gives its guests hints when using hypercall is preferred. While doing hypercalls for local TLB flushes is probably not practical (and is not being suggested by modern Hyper-V versions) remote TLB flush with a hypercall brings significant improvement.

To test the series I wrote a special 'TLB trasher': on a 16 vCPU guest I was creating 32 threads which were doing 100000 mmap/munmaps each on some big file. Here are the results:

Before:

# time ./pthread_mmap ./randfile 
real	3m33.118s
user	0m3.698s
sys	3m16.624s

After:

# time ./pthread_mmap ./randfile 
real	2m19.920s
user	0m2.662s
sys	2m9.948s

This series brings a number of small improvements along the way: fast hypercall implementation and using it for event signaling, rep hypercalls implementation, hyperv tracing subsystem (which only traces the newly added remote TLB flush for now).

Vitaly Kuznetsov (9):
x86/hyper-v: include hyperv/ only when CONFIG_HYPERV is set x86/hyper-v: make hv_do_hypercall() inline x86/hyper-v: fast hypercall implementation
hyper-v: use fast hypercall for HVCALL_SIGNAL_EVENT x86/hyper-v: implement rep hypercalls
hyper-v: globalize vp_index
x86/hyper-v: use hypercall for remote TLB flush x86/hyper-v: support extended CPU ranges for TLB flush hypercalls tracing/hyper-v: trace hyperv_mmu_flush_tlb_others()

 MAINTAINERS                         |   1 +
 arch/x86/Kbuild                     |   2 +-
 arch/x86/hyperv/Makefile            |   2 +-
 arch/x86/hyperv/hv_init.c           |  90 ++++++------
 arch/x86/hyperv/mmu.c               | 272 ++++++++++++++++++++++++++++++++++++
 arch/x86/include/asm/mshyperv.h     | 147 ++++++++++++++++++-
 arch/x86/include/asm/trace/hyperv.h |  40 ++++++
 arch/x86/include/uapi/asm/hyperv.h  |  17 +++
 arch/x86/kernel/cpu/mshyperv.c      |   1 +
 drivers/hv/channel_mgmt.c           |  20 +--
 drivers/hv/connection.c             |   7 +-
 drivers/hv/hv.c                     |   9 --
 drivers/hv/hyperv_vmbus.h           |  11 --
 drivers/hv/vmbus_drv.c              |  17 ---
 drivers/pci/host/pci-hyperv.c       |  54 +------
 include/linux/hyperv.h              |  17 +--
 16 files changed, 533 insertions(+), 174 deletions(-)
 create mode 100644 arch/x86/hyperv/mmu.c
 create mode 100644 arch/x86/include/asm/trace/hyperv.h
Signature · 1 line
2.13.3