diff options
author | Junaid Shahid <junaids@google.com> | 2019-01-03 17:14:28 -0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-06-05 14:14:50 +0200 |
commit | 0d9ce162cf46c99628cc5da9510b959c7976735b (patch) | |
tree | cb7670bedf8c614aa20313b95456f942fd16b6d4 /arch/x86/kvm/mmu.c | |
parent | 1ae4de23eddef465104277e79fa669bec7b3d288 (diff) | |
download | lwn-0d9ce162cf46c99628cc5da9510b959c7976735b.tar.gz lwn-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.c | 4 |
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; } |