All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] support dirtyrate measurement with dirty bitmap
@ 2021-07-12 16:56 huangy81
       [not found] ` <cover.1626108969.git.huangy81@chinatelecom.cn>
  0 siblings, 1 reply; 5+ messages in thread
From: huangy81 @ 2021-07-12 16:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, Juan Quintela, Hyman, Dr. David Alan Gilbert,
	Peter Xu, Chuan Zheng, Paolo Bonzini

From: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>

v2:
- drop the DIRTY_MEMORY_DIRTY_RATE dirty bits

- reuse the DIRTY_MEMORY_MIGRATION dirty bits to stat the dirty
  pages.

- introduce global var DirtyRateIncreasedPages to stat the
  increased dirty pages

- simplify the logic of calculation. skip the 1'round of
  log sync unconditionally

changes of this version are based on Peter's advice,
like the version 1, it is posted for the sake of RFC.
ideally, this patshset may be merged after the commit:
"migration/dirtyrate: implement dirty-ring dirtyrate calculation"

v1:
the dirtyrate measurement implemented by page-sampling originally, it
is not accurate in some scenarios, so we have introduced dirty-ring
based dirtyrate measurement(maybe it will be merged soon), it fix the
accuracy of page-sampling, and more importantly, it is at the
granualrity of vcpu.

dirty-ring method can be used when dirty-ring enable, as supplementary,
we introduce dirty-bitmap method to calculating dirtyrate when dirty log
enable, so that we can also get the accurate dirtyrate if needed in the
absence of dirty-ring.

three things has done to implement the measurement:
- introduce a fresh new dirty bits named DIRTY_MEMORY_DIRTY_RATE, which
  is used to store dirty bitmap after fetching it from kvm. why we do
  not reuse the existing DIRTY_MEMORY_MIGRATION dirty bits is we do not
  want to interfere with migration of and let implementation clear, this 
  is also the reason why dirty_memory be split.

  DIRTY_MEMORY_DIRTY_RATE dirty bits will be filled when
  memory_global_dirty_log_sync executed if GLOBAL_DIRTY_DIRTY_RATE bit
  be set in the global_dirty_tracking flag.

- introduce kvm_get_manual_dirty_log_protect function so that we can
  probe the protect caps of kvm when calculating.

- implement dirtyrate measurement with dirty bitmap with following step:
  1. start the dirty log. 

  2. probe the protect cap, if KVM_DIRTY_LOG_INITIALLY_SET enable, skip
     skip the 1'R and do the reset page protection manually, since kvm
     file bitmap with 1 bits if this cap is enabled. 

  3. clear the DIRTY_MEMORY_DIRTY_RATE dirty bits, prepare to store 
     the dirty bitmap.

  4. start memory_global_dirty_log_sync and fetch dirty bitmap from kvm

  5. reap the DIRTY_MEMORY_DIRTY_RATE dirty bits and do the calculation.

this patchset rebases on the commit 
"migration/dirtyrate: implement dirty-ring dirtyrate calculation",
since the above feature has not been merged, so we post this patch
for the sake of RFC. ideally, this patshset may be merged after it.

Please, review, thanks !

Best Regards !

Hyman Huang(黄勇) (3):
  KVM: introduce kvm_get_manual_dirty_log_protect
  memory: introduce DirtyRateIncreasedPages and util function
  migration/dirtyrate: implement dirty-bitmap dirtyrate calculation

 accel/kvm/kvm-all.c     |   6 +++
 hmp-commands.hx         |   9 ++--
 include/exec/ram_addr.h |  87 ++++++++++++++++++++++++++----
 include/sysemu/kvm.h    |   1 +
 migration/dirtyrate.c   | 138 ++++++++++++++++++++++++++++++++++++++++++++----
 migration/trace-events  |   1 +
 qapi/migration.json     |   6 ++-
 softmmu/physmem.c       |  35 ++++++++++++
 8 files changed, 259 insertions(+), 24 deletions(-)

-- 
1.8.3.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-13 17:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-12 16:56 [PATCH v2 0/3] support dirtyrate measurement with dirty bitmap huangy81
     [not found] ` <cover.1626108969.git.huangy81@chinatelecom.cn>
2021-07-12 16:56   ` [PATCH v2 1/3] KVM: introduce kvm_get_manual_dirty_log_protect huangy81
2021-07-12 16:56   ` [PATCH v2 2/3] memory: introduce DirtyRateIncreasedPages and util function huangy81
2021-07-13 17:49     ` Peter Xu
2021-07-12 16:56   ` [PATCH v2 3/3] migration/dirtyrate: implement dirty-bitmap dirtyrate calculation huangy81

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.