[PATCH v3 0/7] support dirtyrate at the granualrity of vcpu

huangy81@chinatelecom.cn posted 7 patches 2 years, 10 months ago
Test checkpatch failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/cover.1623027729.git.huangy81@chinatelecom.cn
There is a newer version of this series
accel/kvm/kvm-all.c    |   7 +
hmp-commands-info.hx   |  13 ++
hmp-commands.hx        |  15 ++
include/exec/memory.h  |  13 +-
include/hw/core/cpu.h  |   1 +
include/monitor/hmp.h  |   2 +
include/sysemu/kvm.h   |   1 +
migration/dirtyrate.c  | 347 ++++++++++++++++++++++++++++++++++++++---
migration/dirtyrate.h  |  27 +++-
migration/ram.c        |   8 +-
migration/trace-events |   5 +
qapi/migration.json    |  38 ++++-
softmmu/memory.c       |  36 +++--
13 files changed, 468 insertions(+), 45 deletions(-)
[PATCH v3 0/7] support dirtyrate at the granualrity of vcpu
Posted by huangy81@chinatelecom.cn 2 years, 10 months ago
From: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>

v3:
- pick up "migration/dirtyrate: make sample page count configurable" to
  make patchset apply master correctly

v2:
- rebase to "migration/dirtyrate: make sample page count configurable"

- rename "vcpu" to "per_vcpu" to show the per-vcpu method

- squash patch 5/6 into a single one, squash patch 1/2 also 

- pick up "hmp: Add "calc_dirty_rate" and "info dirty_rate" cmds"

- make global_dirty_log a bitmask to make sure both migration and dirty
  could not intefer with each other

- add memory free callback to prevent memory leaking 

the most different of v2 fron v1 is that we make the global_dirty_log a 
bitmask. the reason is dirty rate measurement may start or stop dirty
logging during calculation. this conflict with migration because stop
dirty log make migration leave dirty pages out then that'll be a
problem.

make global_dirty_log a bitmask can let both migration and dirty
rate measurement work fine. introduce GLOBAL_DIRTY_MIGRATION and
GLOBAL_DIRTY_DIRTY_RATE to distinguish what current dirty log aims
for, migration or dirty rate.
    
all references to global_dirty_log should be untouched because any bit
set there should justify that global dirty logging is enabled.

Please review, thanks !

v1:

Since the Dirty Ring on QEMU part has been merged recently, how to use
this feature is under consideration.

In the scene of migration, it is valuable to provide a more accurante
interface to track dirty memory than existing one, so that the upper
layer application can make a wise decision, or whatever. More
importantly,
dirtyrate info at the granualrity of vcpu could provide a possibility to
make migration convergent by imposing restriction on vcpu. With Dirty
Ring, we can calculate dirtyrate efficiently and cheaply.

The old interface implemented by sampling pages, it consumes cpu 
resource, and the larger guest memory size become, the more cpu resource
it consumes, namely, hard to scale. New interface has no such drawback.

Please review, thanks !

Best Regards !

Hyman Huang(黄勇) (6):
  migration/dirtyrate: make sample page count configurable
  KVM: introduce dirty_pages and kvm_dirty_ring_enabled
  migration/dirtyrate: add per-vcpu option for calc-dirty-rate
  migration/dirtyrate: adjust struct DirtyRateStat
  memory: make global_dirty_log a bitmask
  migration/dirtyrate: implement dirty-ring dirtyrate calculation

Peter Xu (1):
  hmp: Add "calc_dirty_rate" and "info dirty_rate" cmds

 accel/kvm/kvm-all.c    |   7 +
 hmp-commands-info.hx   |  13 ++
 hmp-commands.hx        |  15 ++
 include/exec/memory.h  |  13 +-
 include/hw/core/cpu.h  |   1 +
 include/monitor/hmp.h  |   2 +
 include/sysemu/kvm.h   |   1 +
 migration/dirtyrate.c  | 347 ++++++++++++++++++++++++++++++++++++++---
 migration/dirtyrate.h  |  27 +++-
 migration/ram.c        |   8 +-
 migration/trace-events |   5 +
 qapi/migration.json    |  38 ++++-
 softmmu/memory.c       |  36 +++--
 13 files changed, 468 insertions(+), 45 deletions(-)

-- 
2.18.2


Re: [PATCH v3 0/7] support dirtyrate at the granualrity of vcpu
Posted by no-reply@patchew.org 2 years, 10 months ago
Patchew URL: https://patchew.org/QEMU/cover.1623027729.git.huangy81@chinatelecom.cn/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: cover.1623027729.git.huangy81@chinatelecom.cn
Subject: [PATCH v3 0/7] support dirtyrate at the granualrity of vcpu  

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
db25537 migration/dirtyrate: implement dirty-ring dirtyrate calculation
720f923 memory: make global_dirty_log a bitmask
a3323fd migration/dirtyrate: adjust struct DirtyRateStat
04b16bd migration/dirtyrate: add per-vcpu option for calc-dirty-rate
0ec6909 KVM: introduce dirty_pages and kvm_dirty_ring_enabled
8828757 hmp: Add "calc_dirty_rate" and "info dirty_rate" cmds
dd4342c migration/dirtyrate: make sample page count configurable

=== OUTPUT BEGIN ===
1/7 Checking commit dd4342c3ec2f (migration/dirtyrate: make sample page count configurable)
2/7 Checking commit 8828757e0b0e (hmp: Add "calc_dirty_rate" and "info dirty_rate" cmds)
3/7 Checking commit 0ec6909b55f6 (KVM: introduce dirty_pages and kvm_dirty_ring_enabled)
4/7 Checking commit 04b16bd9b236 (migration/dirtyrate: add per-vcpu option for calc-dirty-rate)
ERROR: Error messages should not contain newlines
#42: FILE: migration/dirtyrate.c:427:
+                         "only one of then can be specified!\n");

total: 1 errors, 0 warnings, 158 lines checked

Patch 4/7 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

5/7 Checking commit a3323fddecd9 (migration/dirtyrate: adjust struct DirtyRateStat)
6/7 Checking commit 720f923fec0d (memory: make global_dirty_log a bitmask)
ERROR: spaces required around that '<<' (ctx:VxV)
#36: FILE: include/exec/memory.h:58:
+#define GLOBAL_DIRTY_MIGRATION  (1U<<0)
                                    ^

ERROR: spaces required around that '<<' (ctx:VxV)
#37: FILE: include/exec/memory.h:59:
+#define GLOBAL_DIRTY_DIRTY_RATE (1U<<1)
                                    ^

total: 2 errors, 0 warnings, 145 lines checked

Patch 6/7 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

7/7 Checking commit db255379e746 (migration/dirtyrate: implement dirty-ring dirtyrate calculation)
ERROR: do not initialise globals to 0 or NULL
#75: FILE: migration/dirtyrate.c:47:
+bool register_powerdown_callback = false;

WARNING: Block comments use a leading /* on a separate line
#208: FILE: migration/dirtyrate.c:437:
+    /* migration is in process, do not stop dirty logging,

WARNING: Block comments use a trailing */ on a separate line
#209: FILE: migration/dirtyrate.c:438:
+     * just clear the GLOBAL_DIRTY_DIRTY_RATE bit */

total: 1 errors, 2 warnings, 322 lines checked

Patch 7/7 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/cover.1623027729.git.huangy81@chinatelecom.cn/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [PATCH v3 0/7] support dirtyrate at the granualrity of vcpu
Posted by Hyman 2 years, 10 months ago
cc Chuan Zheng <zhengchuan@huawei.com>

在 2021/6/7 9:11, huangy81@chinatelecom.cn 写道:
> From: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
> 
> v3:
> - pick up "migration/dirtyrate: make sample page count configurable" to
>    make patchset apply master correctly
> 
> v2:
> - rebase to "migration/dirtyrate: make sample page count configurable"
> 
> - rename "vcpu" to "per_vcpu" to show the per-vcpu method
> 
> - squash patch 5/6 into a single one, squash patch 1/2 also
> 
> - pick up "hmp: Add "calc_dirty_rate" and "info dirty_rate" cmds"
> 
> - make global_dirty_log a bitmask to make sure both migration and dirty
>    could not intefer with each other
> 
> - add memory free callback to prevent memory leaking
> 
> the most different of v2 fron v1 is that we make the global_dirty_log a
> bitmask. the reason is dirty rate measurement may start or stop dirty
> logging during calculation. this conflict with migration because stop
> dirty log make migration leave dirty pages out then that'll be a
> problem.
> 
> make global_dirty_log a bitmask can let both migration and dirty
> rate measurement work fine. introduce GLOBAL_DIRTY_MIGRATION and
> GLOBAL_DIRTY_DIRTY_RATE to distinguish what current dirty log aims
> for, migration or dirty rate.
>      
> all references to global_dirty_log should be untouched because any bit
> set there should justify that global dirty logging is enabled.
> 
> Please review, thanks !
> 
> v1:
> 
> Since the Dirty Ring on QEMU part has been merged recently, how to use
> this feature is under consideration.
> 
> In the scene of migration, it is valuable to provide a more accurante
> interface to track dirty memory than existing one, so that the upper
> layer application can make a wise decision, or whatever. More
> importantly,
> dirtyrate info at the granualrity of vcpu could provide a possibility to
> make migration convergent by imposing restriction on vcpu. With Dirty
> Ring, we can calculate dirtyrate efficiently and cheaply.
> 
> The old interface implemented by sampling pages, it consumes cpu
> resource, and the larger guest memory size become, the more cpu resource
> it consumes, namely, hard to scale. New interface has no such drawback.
> 
> Please review, thanks !
> 
> Best Regards !
> 
> Hyman Huang(黄勇) (6):
>    migration/dirtyrate: make sample page count configurable
>    KVM: introduce dirty_pages and kvm_dirty_ring_enabled
>    migration/dirtyrate: add per-vcpu option for calc-dirty-rate
>    migration/dirtyrate: adjust struct DirtyRateStat
>    memory: make global_dirty_log a bitmask
>    migration/dirtyrate: implement dirty-ring dirtyrate calculation
> 
> Peter Xu (1):
>    hmp: Add "calc_dirty_rate" and "info dirty_rate" cmds
> 
>   accel/kvm/kvm-all.c    |   7 +
>   hmp-commands-info.hx   |  13 ++
>   hmp-commands.hx        |  15 ++
>   include/exec/memory.h  |  13 +-
>   include/hw/core/cpu.h  |   1 +
>   include/monitor/hmp.h  |   2 +
>   include/sysemu/kvm.h   |   1 +
>   migration/dirtyrate.c  | 347 ++++++++++++++++++++++++++++++++++++++---
>   migration/dirtyrate.h  |  27 +++-
>   migration/ram.c        |   8 +-
>   migration/trace-events |   5 +
>   qapi/migration.json    |  38 ++++-
>   softmmu/memory.c       |  36 +++--
>   13 files changed, 468 insertions(+), 45 deletions(-)
>