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
..
2020-02-08 13:26:41 -08:00
2020-01-21 11:06:12 +05:30
2020-02-08 14:04:19 -08:00
2020-01-29 09:51:36 -08:00
2020-01-18 14:26:13 +00:00
2020-02-08 10:01:33 +00:00
2020-02-04 07:17:41 +00:00
2020-01-31 14:40:36 -08:00
2020-02-06 12:24:24 -08:00
2020-01-28 16:02:33 -08:00
2020-01-27 17:49:15 +01:00
2020-01-24 20:54:29 +01:00
2020-02-08 17:15:08 -08:00
2020-01-27 14:35:32 +01:00
2020-01-20 10:29:56 -08:00
2020-01-20 10:29:56 -08:00
2020-01-28 10:07:09 -08:00
2020-02-08 14:04:19 -08:00
2020-01-23 12:37:18 +00:00
2020-02-07 17:39:56 -08:00
2020-01-29 10:09:44 -08:00
2020-01-24 21:03:53 +01:00
2020-01-31 10:30:36 -08:00
2020-02-04 03:05:26 +00:00
2020-02-04 03:05:26 +00:00
2020-01-29 18:16:16 -08:00
2020-01-22 23:04:52 +01:00
2020-01-29 16:40:54 +01:00
2020-01-22 23:04:52 +01:00
2020-01-31 13:14:26 -08:00
2020-01-27 10:24:32 +01:00
2020-01-21 13:28:24 +01:00
2020-01-27 19:59:55 +01:00
2020-01-27 10:24:32 +01:00
2020-01-27 10:33:33 +01:00
2020-02-08 14:04:19 -08:00
2020-01-23 00:35:50 +01:00
2020-02-04 03:05:27 +00:00
2020-01-27 10:55:50 -08:00
2020-01-20 08:14:29 +01:00
2020-01-27 11:09:31 +01:00
2020-02-03 17:27:38 -07:00
2020-01-29 15:45:47 -07:00
2020-01-17 16:48:07 -08:00
2020-01-18 09:19:18 -05:00
2020-01-16 20:03:34 -08:00
2020-02-07 14:48:39 -05:00
2020-02-07 14:48:38 -05:00
2020-02-08 13:26:41 -08:00
2020-01-22 14:50:03 -08:00
2020-01-28 10:07:09 -08:00
2020-01-27 20:00:01 +01:00
2020-01-23 13:15:09 -08:00
2020-01-26 22:10:17 -05:00
2020-01-30 07:39:10 -08:00
2020-01-22 15:22:51 -05:00
2020-01-31 10:30:41 -08:00
2020-01-24 15:39:39 +01:00
2020-02-01 09:31:47 +01:00
2020-02-09 12:11:12 -08:00
2020-01-25 03:01:56 -05:00
2020-01-31 17:33:54 +00:00
2020-03-16 17:57:37 +01:00
2020-01-30 18:45:55 +01:00
2020-02-06 06:11:50 +00:00
2020-01-28 08:46:13 -08:00
2020-01-31 10:30:38 -08:00
2020-02-04 03:05:23 +00:00
2020-01-31 10:30:39 -08:00
2020-02-04 07:21:04 +00:00
2020-02-04 07:24:48 +00:00
2020-02-04 03:05:23 +00:00
2020-02-01 10:01:52 -08:00
2020-01-29 11:20:24 -08:00
2020-01-27 11:00:21 +01:00
2020-01-27 11:31:35 +01:00
2020-02-04 10:50:44 -05:00
2020-01-24 16:51:13 -05:00
2020-02-05 14:52:03 -08:00
2020-01-31 10:30:39 -08:00
2020-02-04 03:05:25 +00:00
2020-01-29 17:00:02 -06:00
2020-01-31 11:15:59 -08:00
2020-01-20 17:04:02 -07:00
2020-02-09 12:04:09 -08:00
2020-01-21 10:50:41 +01:00
2020-02-08 11:39:19 -08:00
2020-01-23 13:15:09 -08:00
2020-02-04 03:05:26 +00:00
2020-01-29 11:20:24 -08:00
2020-02-04 03:05:25 +00:00
2020-02-07 14:48:37 -05:00
2020-01-25 12:18:50 -05:00
2020-01-24 10:24:31 -08:00
2020-01-25 10:05:23 +01:00
2020-01-24 10:37:27 -08:00
2020-01-24 10:24:31 -08:00
2020-01-24 10:24:31 -08:00
2020-01-20 16:19:10 +01:00
2020-01-29 19:38:34 -08:00
2020-02-04 03:05:26 +00:00
2020-02-07 14:48:37 -05:00
2020-02-06 13:59:10 +01:00
2020-02-04 03:05:24 +00:00
2020-01-24 20:40:09 +01:00
2020-01-17 10:19:21 +01:00
2020-02-04 03:05:26 +00:00
2020-01-31 10:30:40 -08:00
2020-01-29 19:38:34 -08:00
2020-01-29 17:45:20 +01:00
2020-01-31 10:30:40 -08:00
2020-02-06 07:12:11 +00:00
2020-01-31 10:30:39 -08:00
2020-01-17 22:33:37 -05:00
2020-01-31 10:30:40 -08:00