KVM: Use interval tree to do fast hva lookup in memslots
The current memslots implementation only allows quick binary search by gfn,
quick lookup by hva is not possible - the implementation has to do a linear
scan of the whole memslots array, even though the operation being performed
might apply just to a single memslot.
This significantly hurts performance of per-hva operations with higher
memslot counts.
Since hva ranges can overlap between memslots an interval tree is needed
for tracking them.
[sean: handle interval tree updates in kvm_replace_memslot()]
Signed-off-by:
Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Message-Id: <d66b9974becaa9839be9c4e1a5de97b177b4ac20.1638817640.git.maciej.szmigiero@oracle.com>
Showing
- arch/arm64/kvm/Kconfig 1 addition, 0 deletionsarch/arm64/kvm/Kconfig
- arch/mips/kvm/Kconfig 1 addition, 0 deletionsarch/mips/kvm/Kconfig
- arch/powerpc/kvm/Kconfig 1 addition, 0 deletionsarch/powerpc/kvm/Kconfig
- arch/s390/kvm/Kconfig 1 addition, 0 deletionsarch/s390/kvm/Kconfig
- arch/x86/kvm/Kconfig 1 addition, 0 deletionsarch/x86/kvm/Kconfig
- include/linux/kvm_host.h 3 additions, 0 deletionsinclude/linux/kvm_host.h
- virt/kvm/kvm_main.c 39 additions, 14 deletionsvirt/kvm/kvm_main.c
Please register or sign in to comment