diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2012-08-26 12:58:41 -0400 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2012-08-26 12:58:41 -0400 |
commit | c78aa4c4b94b5b148be576a9f1570e31fe282b46 (patch) | |
tree | 6d5801eb3e60bcec6a91c7b13a334c6d2ea11b05 /arch/x86/kvm/mmu.c | |
parent | 90993cdd1800dc6ef9587431a0c625b978584e81 (diff) | |
parent | 9acb172543aecb783e2e1e53e3f447d4c0f5c150 (diff) |
Merge remote-tracking branch 'upstream/master' into queue
Merging critical fixes from upstream required for development.
* upstream/master: (809 commits)
libata: Add a space to " 2GB ATA Flash Disk" DMA blacklist entry
Revert "powerpc: Update g5_defconfig"
powerpc/perf: Use pmc_overflow() to detect rolled back events
powerpc: Fix VMX in interrupt check in POWER7 copy loops
powerpc: POWER7 copy_to_user/copy_from_user patch applied twice
powerpc: Fix personality handling in ppc64_personality()
powerpc/dma-iommu: Fix IOMMU window check
powerpc: Remove unnecessary ifdefs
powerpc/kgdb: Restore current_thread_info properly
powerpc/kgdb: Bail out of KGDB when we've been triggered
powerpc/kgdb: Do not set kgdb_single_step on ppc
powerpc/mpic_msgr: Add missing includes
powerpc: Fix null pointer deref in perf hardware breakpoints
powerpc: Fixup whitespace in xmon
powerpc: Fix xmon dl command for new printk implementation
xfs: check for possible overflow in xfs_ioc_trim
xfs: unlock the AGI buffer when looping in xfs_dialloc
xfs: fix uninitialised variable in xfs_rtbuf_get()
powerpc/fsl: fix "Failed to mount /dev: No such device" errors
powerpc/fsl: update defconfigs
...
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r-- | arch/x86/kvm/mmu.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 8e312a2e1412..399c177212b5 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -4155,16 +4155,21 @@ static int mmu_shrink(struct shrinker *shrink, struct shrink_control *sc) | |||
4155 | LIST_HEAD(invalid_list); | 4155 | LIST_HEAD(invalid_list); |
4156 | 4156 | ||
4157 | /* | 4157 | /* |
4158 | * Never scan more than sc->nr_to_scan VM instances. | ||
4159 | * Will not hit this condition practically since we do not try | ||
4160 | * to shrink more than one VM and it is very unlikely to see | ||
4161 | * !n_used_mmu_pages so many times. | ||
4162 | */ | ||
4163 | if (!nr_to_scan--) | ||
4164 | break; | ||
4165 | /* | ||
4158 | * n_used_mmu_pages is accessed without holding kvm->mmu_lock | 4166 | * n_used_mmu_pages is accessed without holding kvm->mmu_lock |
4159 | * here. We may skip a VM instance errorneosly, but we do not | 4167 | * here. We may skip a VM instance errorneosly, but we do not |
4160 | * want to shrink a VM that only started to populate its MMU | 4168 | * want to shrink a VM that only started to populate its MMU |
4161 | * anyway. | 4169 | * anyway. |
4162 | */ | 4170 | */ |
4163 | if (kvm->arch.n_used_mmu_pages > 0) { | 4171 | if (!kvm->arch.n_used_mmu_pages) |
4164 | if (!nr_to_scan--) | ||
4165 | break; | ||
4166 | continue; | 4172 | continue; |
4167 | } | ||
4168 | 4173 | ||
4169 | idx = srcu_read_lock(&kvm->srcu); | 4174 | idx = srcu_read_lock(&kvm->srcu); |
4170 | spin_lock(&kvm->mmu_lock); | 4175 | spin_lock(&kvm->mmu_lock); |