diff options
author | Takuya Yoshikawa | 2012-07-02 17:55:48 +0900 |
---|---|---|
committer | Marcelo Tosatti | 2012-07-18 16:55:04 -0300 |
commit | 84504ef38673fa021b3d8f3da2b79cf878b33315 (patch) | |
tree | 55c6238ebfa17790dad0136493b7b0f375828ace /arch/x86/kernel/pci-dma.c | |
parent | d19a748b1c42b133e9263e9023c1d162efa6f4ad (diff) |
KVM: MMU: Make kvm_handle_hva() handle range of addresses
When guest's memory is backed by THP pages, MMU notifier needs to call
kvm_unmap_hva(), which in turn leads to kvm_handle_hva(), in a loop to
invalidate a range of pages which constitute one huge page:
for each page
for each memslot
if page is in memslot
unmap using rmap
This means although every page in that range is expected to be found in
the same memslot, we are forced to check unrelated memslots many times.
If the guest has more memslots, the situation will become worse.
Furthermore, if the range does not include any pages in the guest's
memory, the loop over the pages will just consume extra time.
This patch, together with the following patches, solves this problem by
introducing kvm_handle_hva_range() which makes the loop look like this:
for each memslot
for each page in memslot
unmap using rmap
In this new processing, the actual work is converted to a loop over rmap
which is much more cache friendly than before.
Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Cc: Alexander Graf <agraf@suse.de>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kernel/pci-dma.c')
0 files changed, 0 insertions, 0 deletions