summaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2016-02-03 10:18:41 +0100
committerChristian Borntraeger <borntraeger@de.ibm.com>2016-02-10 13:12:56 +0100
commitab99a1cc7a405fed5148cf6a6fc26eec75b8a7a7 (patch)
treee14e35351435069a1879d3868f8ea9b8c851837b /arch/s390/kvm
parent8a08b9c7379dc881ff5f00c086877353888a982f (diff)
downloadblackbird-op-linux-ab99a1cc7a405fed5148cf6a6fc26eec75b8a7a7.tar.gz
blackbird-op-linux-ab99a1cc7a405fed5148cf6a6fc26eec75b8a7a7.zip
KVM: s390: do not take mmap_sem on dirty log query
Dirty log query can take a long time for huge guests. Holding the mmap_sem for very long times can cause some unwanted latencies. Turns out that we do not need to hold the mmap semaphore. We hold the slots_lock for gfn->hva translation and walk the page tables with that address, so no need to look at the VMAs. KVM also holds a reference to the mm, which should prevent other things going away. During the walk we take the necessary ptl locks. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm')
-rw-r--r--arch/s390/kvm/kvm-s390.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index d0dcf73f36bc..d4bcd863b24a 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -274,7 +274,6 @@ static void kvm_s390_sync_dirty_log(struct kvm *kvm,
unsigned long address;
struct gmap *gmap = kvm->arch.gmap;
- down_read(&gmap->mm->mmap_sem);
/* Loop over all guest pages */
last_gfn = memslot->base_gfn + memslot->npages;
for (cur_gfn = memslot->base_gfn; cur_gfn <= last_gfn; cur_gfn++) {
@@ -283,7 +282,6 @@ static void kvm_s390_sync_dirty_log(struct kvm *kvm,
if (gmap_test_and_clear_dirty(address, gmap))
mark_page_dirty(kvm, cur_gfn);
}
- up_read(&gmap->mm->mmap_sem);
}
/* Section: vm related */
OpenPOWER on IntegriCloud