linux/arch/x86
Takuya Yoshikawa 6b81b05e44 KVM: MMU: Conditionally reschedule when kvm_mmu_slot_remove_write_access() takes a long time
If the userspace starts dirty logging for a large slot, say 64GB of
memory, kvm_mmu_slot_remove_write_access() needs to hold mmu_lock for
a long time such as tens of milliseconds.  This patch controls the lock
hold time by asking the scheduler if we need to reschedule for others.

One penalty for this is that we need to flush TLBs before releasing
mmu_lock.  But since holding mmu_lock for a long time does affect not
only the guest, vCPU threads in other words, but also the host as a
whole, we should pay for that.

In practice, the cost will not be so high because we can protect a fair
amount of memory before being rescheduled: on my test environment,
cond_resched_lock() was called only once for protecting 12GB of memory
even without THP.  We can also revisit Avi's "unlocked TLB flush" work
later for completely suppressing extra TLB flushes if needed.

Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
2013-01-14 11:14:28 +02:00
..
boot PCI changes for the v3.8 merge window: 2012-12-13 12:14:47 -08:00
configs x86/Kconfig: Turn off DEBUG_NX_TEST module in defconfigs 2012-09-05 10:43:12 +02:00
crypto crypto: aesni - fix XTS mode on x86-32, add wrapper function for asmlinkage aesni_enc() 2012-10-18 14:01:33 -07:00
ia32 x86, um: switch to generic fork/vfork/clone 2012-11-28 22:13:44 -05:00
include KVM: Remove unused slot_bitmap from kvm_mmu_page 2013-01-14 11:13:58 +02:00
kernel Merge tag 'kvm-3.8-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2012-12-13 15:31:08 -08:00
kvm KVM: MMU: Conditionally reschedule when kvm_mmu_slot_remove_write_access() takes a long time 2013-01-14 11:14:28 +02:00
lguest virtio: remove CONFIG_VIRTIO_RING 2012-09-28 15:05:15 +09:30
lib Merge branch 'x86-nuke386-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-12-11 19:59:32 -08:00
math-emu
mm Merge branch 'akpm' (Andrew's patch-bomb) 2012-12-13 13:11:15 -08:00
net x86: bpf_jit_comp: add vlan tag support 2012-10-31 14:00:15 -04:00
oprofile oprofile, x86: Fix wrapping bug in op_x86_get_ctrl() 2012-10-15 14:38:24 +02:00
pci PCI changes for the v3.8 merge window: 2012-12-13 12:14:47 -08:00
platform TTY/Serial merge for 3.8-rc1 2012-12-11 14:08:47 -08:00
power x86, topology: Debug CPU0 hotplug 2012-11-14 15:28:11 -08:00
realmode x86, suspend: Correct the restore of CR4, EFER; skip computing EFLAGS.ID 2012-10-02 08:42:31 +02:00
syscalls x86, um: switch to generic fork/vfork/clone 2012-11-28 22:13:44 -05:00
tools x86: Fix the error of using "const" in gen-insn-attr-x86.awk 2012-12-10 10:31:24 -08:00
um Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal 2012-12-12 12:22:13 -08:00
vdso Merge tag 'kvm-3.8-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2012-12-13 15:31:08 -08:00
video
xen Features: 2012-12-13 14:29:16 -08:00
.gitignore
Kbuild
Kconfig PCI changes for the v3.8 merge window: 2012-12-13 12:14:47 -08:00
Kconfig.cpu x86, 386 removal: Document Nx586 as a 386 and thus unsupported 2012-11-29 13:28:39 -08:00
Kconfig.debug x86/tlb: add tlb_flushall_shift knob into debugfs 2012-06-27 19:29:10 -07:00
Makefile kbuild: Fix accidental revert in commit fe04ddf 2012-10-15 13:01:05 -07:00
Makefile.um
Makefile_32.cpu x86, 386 removal: Remove CONFIG_M386 from Kconfig 2012-11-29 13:23:01 -08:00