summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mmu.c
diff options
context:
space:
mode:
authorJunaid Shahid2019-01-04 02:14:28 +0100
committerPaolo Bonzini2019-06-05 14:14:50 +0200
commit0d9ce162cf46c99628cc5da9510b959c7976735b (patch)
treecb7670bedf8c614aa20313b95456f942fd16b6d4 /arch/x86/kvm/mmu.c
parentKVM: VMX: remove unneeded 'asm volatile ("")' from vmcs_write64 (diff)
downloadkernel-qcow2-linux-0d9ce162cf46c99628cc5da9510b959c7976735b.tar.gz
kernel-qcow2-linux-0d9ce162cf46c99628cc5da9510b959c7976735b.tar.xz
kernel-qcow2-linux-0d9ce162cf46c99628cc5da9510b959c7976735b.zip
kvm: Convert kvm_lock to a mutex
It doesn't seem as if there is any particular need for kvm_lock to be a spinlock, so convert the lock to a mutex so that sleepable functions (in particular cond_resched()) can be called while holding it. Signed-off-by: Junaid Shahid <junaids@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r--arch/x86/kvm/mmu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 95ac393e2959..3384c539d150 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -5956,7 +5956,7 @@ mmu_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
int nr_to_scan = sc->nr_to_scan;
unsigned long freed = 0;
- spin_lock(&kvm_lock);
+ mutex_lock(&kvm_lock);
list_for_each_entry(kvm, &vm_list, vm_list) {
int idx;
@@ -5998,7 +5998,7 @@ mmu_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
break;
}
- spin_unlock(&kvm_lock);
+ mutex_unlock(&kvm_lock);
return freed;
}