linux/Documentation/virt/kvm
Jay Zhou 3c9bd4006b KVM: x86: enable dirty log gradually in small chunks
It could take kvm->mmu_lock for an extended period of time when
enabling dirty log for the first time. The main cost is to clear
all the D-bits of last level SPTEs. This situation can benefit from
manual dirty log protect as well, which can reduce the mmu_lock
time taken. The sequence is like this:

1. Initialize all the bits of the dirty bitmap to 1 when enabling
   dirty log for the first time
2. Only write protect the huge pages
3. KVM_GET_DIRTY_LOG returns the dirty bitmap info
4. KVM_CLEAR_DIRTY_LOG will clear D-bit for each of the leaf level
   SPTEs gradually in small chunks

Under the Intel(R) Xeon(R) Gold 6152 CPU @ 2.10GHz environment,
I did some tests with a 128G windows VM and counted the time taken
of memory_global_dirty_log_start, here is the numbers:

VM Size        Before    After optimization
128G           460ms     10ms

Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-03-16 17:57:37 +01:00
..
arm docs: kvm: arm/psci.txt: convert to ReST 2020-02-12 20:10:01 +01:00
devices docs: kvm: convert devices/xive.txt to ReST 2020-02-12 20:09:58 +01:00
amd-memory-encryption.rst
api.rst KVM: x86: enable dirty log gradually in small chunks 2020-03-16 17:57:37 +01:00
cpuid.rst
halt-polling.rst docs: virt: convert halt-polling.txt to ReST format 2020-02-12 20:09:50 +01:00
hypercalls.rst docs: kvm: Convert hypercalls.txt to ReST format 2020-02-12 20:10:02 +01:00
index.rst docs: kvm: review-checklist.txt: rename to ReST 2020-02-12 20:10:07 +01:00
locking.rst docs: kvm: Convert locking.txt to ReST format 2020-02-12 20:10:02 +01:00
mmu.rst docs: kvm: Convert mmu.txt to ReST format 2020-02-12 20:10:03 +01:00
msr.rst docs: virt: Convert msr.txt to ReST format 2020-02-12 20:09:51 +01:00
nested-vmx.rst docs: kvm: Convert nested-vmx.txt to ReST format 2020-02-12 20:10:04 +01:00
ppc-pv.rst docs: kvm: Convert ppc-pv.txt to ReST format 2020-02-12 20:10:05 +01:00
review-checklist.rst docs: kvm: review-checklist.txt: rename to ReST 2020-02-12 20:10:07 +01:00
s390-diag.rst docs: kvm: Convert s390-diag.txt to ReST format 2020-02-12 20:10:06 +01:00
timekeeping.rst docs: kvm: Convert timekeeping.txt to ReST format 2020-02-12 20:10:06 +01:00
vcpu-requests.rst