Re: [PATCH v3 7/7] migration/dirtyrate: implement dirty-ring dirtyrate calculation

2021-06-11 Thread Hyman Huang
在 2021/6/8 2:36, Peter Xu 写道: On Mon, Jun 07, 2021 at 09:15:20AM +0800, huang...@chinatelecom.cn wrote: From: Hyman Huang(黄勇) use dirty ring feature to implement dirtyrate calculation. to enable it, set vcpu option as true in calc-dirty-rate. add per_vcpu as mandatory option

Re: [PATCH 1/2] tests/migration: parse the thread-id key of CpuInfoFast

2021-06-16 Thread Hyman Huang
在 2021/6/3 22:19, huang...@chinatelecom.cn 写道: From: Hyman Huang(黄勇) thread_id in CpuInfoFast is deprecated, parse thread-id instead after execute qmp query-cpus-fast. fix this so that test can go smoothly. Signed-off-by: Hyman Huang(黄勇) --- tests/migration/guestperf/engine.py | 2

Re: [PATCH 2/2] tests/migration: fix "downtime_limit" type when "migrate-set-parameters"

2021-06-16 Thread Hyman Huang
在 2021/6/3 22:20, huang...@chinatelecom.cn 写道: From: Hyman Huang(黄勇) migrate-set-parameters parse "downtime_limit" as integer type when execute "migrate-set-parameters" before migration, and, the unit dowtime_limit is milliseconds, fix this two so that test can go s

Re: [PATCH v3 4/7] migration/dirtyrate: add per-vcpu option for calc-dirty-rate

2021-06-07 Thread Hyman Huang
is idea is what i'm working on to stat the memory heat(trying to reduce the transferred memory in migration), theoretically it can be used for dirty rate measurement also, maybe i could try it after this patchset work having done. -- Best regard Hyman Huang(黄勇)

Re: [PATCH v7 3/7] memory: make global_dirty_tracking a bitmask

2021-06-17 Thread Hyman Huang
在 2021/6/17 23:29, Peter Xu 写道: On Thu, Jun 17, 2021 at 10:12:04PM +0800, huang...@chinatelecom.cn wrote: From: Hyman Huang(黄勇) dirty rate measurement may start or stop dirty tracking during calculation. this conflict with migration because stop dirty tracking make migration leave dirty

Re: [PATCH v7 3/7] memory: make global_dirty_tracking a bitmask

2021-06-17 Thread Hyman Huang
在 2021/6/17 23:29, Peter Xu 写道: On Thu, Jun 17, 2021 at 10:12:04PM +0800, huang...@chinatelecom.cn wrote: From: Hyman Huang(黄勇) dirty rate measurement may start or stop dirty tracking during calculation. this conflict with migration because stop dirty tracking make migration leave dirty

Re: [PATCH v7 4/7] migration/dirtyrate: introduce struct and adjust DirtyRateStat

2021-06-17 Thread Hyman Huang
by via dirty ring. +# +# Since: 6.1 +# +## +{ 'enum': 'DirtyRateMeasureMode', + 'data': [ 'none', 'page-sampling', 'dirty-ring'] } I still don't get why we need "none" mode. Could you explain? sorry, forget about this modification -- Best regard Hyman Huang(黄勇)

Re: [PATCH v7 6/7] migration/dirtyrate: move init step of calculation to main thread

2021-06-17 Thread Hyman Huang
在 2021/6/17 23:34, Peter Xu 写道: On Thu, Jun 17, 2021 at 10:12:07PM +0800, huang...@chinatelecom.cn wrote: From: Hyman Huang(黄勇) since main thread may "query dirty rate" at any time, it's better to move init step into main thead so that synchronization overhead bet

Re: [PATCH 1/2] tests/migration: parse the thread-id key of CpuInfoFast

2021-06-21 Thread Hyman Huang
cc original author Daniel P. Berrangé :) may be this two fixes can be squashed into a single patch. 在 2021/6/16 14:26, Hyman Huang 写道: 在 2021/6/3 22:19, huang...@chinatelecom.cn 写道: From: Hyman Huang(黄勇) thread_id in CpuInfoFast is deprecated, parse thread-id instead after execute qmp

Re: [PATCH v4 2/6] memory: make global_dirty_log a bitmask

2021-06-16 Thread Hyman Huang
ot at all, since i'm not figure out how this bitmask works clearly, thanks a lot for your guidance. -- Best regard Hyman Huang(黄勇)

Re: [PATCH v3 7/7] migration/dirtyrate: implement dirty-ring dirtyrate calculation

2021-06-11 Thread Hyman Huang
rty rate: 1 vcpu[2], Dirty rate: 0 vcpu[3], Dirty rate: 511 I think if without the division, it'll be 512MB/s, which is matching the dirty workload I initiated. -- Best regard Hyman Huang(黄勇)

Re: [PATCH v1 0/6] support dirtyrate at the granualrity of vcpu

2021-06-01 Thread Hyman Huang
在 2021/6/2 5:54, Peter Xu 写道: On Tue, Jun 01, 2021 at 01:02:45AM +0800, huang...@chinatelecom.cn wrote: From: Hyman Huang(黄勇) 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

Re: [PATCH v1 2/6] KVM: introduce dirty_pages into CPUState

2021-06-01 Thread Hyman Huang
advice, i'll apply this on the next version -- Best regard Hyman Huang(黄勇)

Re: [PATCH v3] migration/dirtyrate: make sample page count configurable

2021-06-01 Thread Hyman Huang
Ping though dirtyrate by sampling page may kind of be inaccurate, it still valuable for those who run qemu on non-x86 or kernel which does not support dirty ring, this patch is necessary i think, what would you think of it ? 在 2021/5/11 22:21, huang...@chinatelecom.cn 写道: From: Hyman Huang(黄勇

Re: [PATCH 0/4] support dirtyrate measurement with dirty bitmap

2021-07-11 Thread Hyman Huang
在 2021/7/10 2:20, Peter Xu 写道: Yong, On Sun, Jun 27, 2021 at 01:38:13PM +0800, huang...@chinatelecom.cn wrote: From: Hyman Huang(黄勇) the dirtyrate measurement implemented by page-sampling originally, it is not accurate in some scenarios, so we have introduced dirty-ring based dirtyrate

Re: [PATCH] tests/migration: fix unix socket migration

2021-07-07 Thread Hyman Huang
Ping cc the author and maintainer 在 2021/6/26 0:33, Hyman 写道: 在 2021/4/29 1:26, Wainer dos Santos Moschetta 写道: Cleber, Maybe you could review then queue this one? Ping it seems that this patch has been left out :) - Wainer On 4/20/21 10:16 PM, Hyman Huang wrote: 在 2021/3/10 0:55

Re: [PATCH] tests/migration: fix parameter of auto-converge migration

2021-03-24 Thread Hyman Huang
在 2021/3/24 13:42, Thomas Huth 写道: On 23/03/2021 20.40, Dr. David Alan Gilbert wrote: * huang...@chinatelecom.cn (huang...@chinatelecom.cn) wrote: From: Hyman Huang(黄勇) when execute the following test command: $ ./guestperf-batch.py --auto-converge \ --auto-converge-step {percent

Re: [PATCH v1] tests/migration: introduce multifd into guestperf

2021-03-23 Thread Hyman Huang
-host localhost --transport unix \ --filter compr-multifd* --output outputdir Signed-off-by: Hyman Huang(黄勇) --- tests/migration/guestperf/comparison.py | 14 ++ tests/migration/guestperf/engine.py | 16 tests/migration/guestperf/scenario.py | 12

Re: [PATCH v1] migration/dirtyrate: make sample page count configurable

2021-04-20 Thread Hyman Huang
在 2021/4/15 1:23, huang...@chinatelecom.cn 写道: From: Hyman Huang(黄勇) introduce optional sample-pages argument in calc-dirty-rate, making sample page count per GB configurable so that more accurate dirtyrate can be calculated. Signed-off-by: Hyman Huang(黄勇) --- migration/dirtyrate.c | 32

Re: [PATCH] tests/migration: fix unix socket migration

2021-04-20 Thread Hyman Huang
gs = ret[1] vcpu_timings = ret[2] -if uri[0:5] == "unix:": +if uri[0:5] == "unix:" and os.path.exists(uri[5:]): os.remove(uri[5:]) if self._verbose: print("Finished migration") Reviewed-by: Philipp

Re: [PATCH v1] tests/migration: introduce multifd into guestperf

2021-04-20 Thread Hyman Huang
在 2021/3/24 9:18, Hyman Huang 写道: cc th...@redhat.com and berra...@redhat.com Please review, thanks 在 2021/3/20 1:04, huang...@chinatelecom.cn 写道: From: Hyman Guestperf tool does not cover the multifd-enabled migration currently, it is worth supporting so that developers can analysis

Re: [PATCH v12 0/6] support dirtyrate at the granualrity of vcpu

2021-10-14 Thread Hyman Huang
在 2021/10/15 9:32, Peter Xu 写道: On Wed, Jun 30, 2021 at 12:01:17AM +0800, huang...@chinatelecom.cn wrote: From: Hyman Huang(黄勇) v12 - adjust the order of calculating dirty rate let memory_global_dirty_log_sync before calculating as v11 version description. Ping for Yong. > D

Re: [PATCH v9 3/3] cpus-common: implement dirty page limit on vCPU

2021-12-04 Thread Hyman Huang
在 2021/12/3 20:34, Markus Armbruster 写道: huang...@chinatelecom.cn writes: From: Hyman Huang(黄勇) Implement dirtyrate calculation periodically basing on dirty-ring and throttle vCPU until it reachs the quota dirty page rate given by user. Introduce qmp commands "vcpu-dirty-limit&quo

Re: [PATCH v10 1/3] migration/dirtyrate: implement vCPU dirtyrate calculation periodically

2021-12-29 Thread Hyman Huang
在 2021/12/23 19:12, Peter Xu 写道: Hi, Yong, On Tue, Dec 14, 2021 at 07:07:32PM +0800, huang...@chinatelecom.cn wrote: From: Hyman Huang(黄勇) Introduce the third method GLOBAL_DIRTY_LIMIT of dirty tracking for calculate dirtyrate periodly for dirty restraint. Implement thread for calculate

Re: [PATCH v10 2/3] cpu-throttle: implement virtual CPU throttle

2021-12-30 Thread Hyman Huang
在 2021/12/24 13:12, Peter Xu 写道: On Tue, Dec 14, 2021 at 07:07:33PM +0800, huang...@chinatelecom.cn wrote: From: Hyman Huang(黄勇) Setup a negative feedback system when vCPU thread handling KVM_EXIT_DIRTY_RING_FULL exit by introducing throttle_us_per_full field in struct CPUState. Sleep

Re: [PATCH v10 2/3] cpu-throttle: implement virtual CPU throttle

2022-01-03 Thread Hyman Huang
在 2022/1/4 10:32, Peter Xu 写道: On Fri, Dec 31, 2021 at 12:36:40AM +0800, Hyman Huang wrote: +struct { +DirtyLimitState *states; +int max_cpus; +unsigned long *bmap; /* running thread bitmap */ +unsigned long nr; +QemuThread thread; +} *dirtylimit_state; + +static bool

Re: [PATCH v5 3/3] cpus-common: implement dirty limit on vCPU

2021-11-25 Thread Hyman Huang
在 2021/11/24 23:33, Markus Armbruster 写道: huang...@chinatelecom.cn writes: From: Hyman Huang(黄勇) Implement dirtyrate calculation periodically basing on dirty-ring and throttle vCPU until it reachs the quota dirtyrate given by user. Introduce qmp commands set-dirty-limit/cancel-dirty

Re: [PATCH v3 3/3] cpus-common: implement dirty limit on vCPU

2021-11-22 Thread Hyman Huang
在 2021/11/22 15:35, Markus Armbruster 写道: huang...@chinatelecom.cn writes: From: Hyman Huang(黄勇) implement dirtyrate calculation periodically basing on dirty-ring and throttle vCPU until it reachs the quota dirtyrate given by user. introduce qmp commands set-dirty-limit/cancel-dirty

Re: [PATCH v3 3/3] cpus-common: implement dirty limit on vCPU

2021-11-22 Thread Hyman Huang
在 2021/11/22 17:10, Markus Armbruster 写道: Hyman Huang writes: =E5=9C=A8 2021/11/22 15:35, Markus Armbruster =E5=86=99=E9=81=93: huang...@chinatelecom.cn writes: From: Hyman Huang(=E9=BB=84=E5=8B=87) implement dirtyrate calculation periodically basing on dirty-ring and throttle vCPU

Re: [PATCH v12 0/6] support dirtyrate at the granualrity of vcpu

2021-10-27 Thread Hyman Huang
the max penalty is 36% during test interval(1s), the average penalty is 20%。 if we trade off accurance, the dirty ring method may be a availiabe method for user. users can select a appropriate method as they need. On 2021/10/15 10:07, Hyman Huang wrote: 在 2021/10/15 9:32, Peter Xu 写道

Re: [PATCH v7 3/3] cpus-common: implement dirty page limit on vCPU

2021-12-02 Thread Hyman Huang
在 2021/12/3 0:02, Markus Armbruster 写道: huang...@chinatelecom.cn writes: From: Hyman Huang(黄勇) Implement dirtyrate calculation periodically basing on dirty-ring and throttle vCPU until it reachs the quota dirty page rate given by user. Introduce qmp commands set-dirty-limit/cancel-dirty

Re: [PATCH v7 1/3] migration/dirtyrate: implement vCPU dirtyrate calculation periodically

2021-11-30 Thread Hyman Huang
} -- Best Regards Hyman Huang(黄勇)

Re: [PATCH v10 3/3] cpus-common: implement dirty page limit on virtual CPU

2021-12-16 Thread Hyman Huang
在 2021/12/16 14:22, Peter Xu 写道: On Wed, Dec 15, 2021 at 02:41:32PM +0100, Markus Armbruster wrote: Peter Xu writes: On Wed, Dec 15, 2021 at 03:56:55PM +0800, Hyman Huang wrote: +{ 'command': 'vcpu-dirty-limit', + 'data': { 'enable': 'bool', +'*cpu-index': 'uint64

Re: [PATCH v7 0/3] support dirty restraint on vCPU

2021-11-30 Thread Hyman Huang
On 11/30/21 22:57, Hyman Huang wrote: 1. Start vm with kernel+initrd.img with qemu command line as following: [root@Hyman_server1 fast_qemu]# cat vm.sh #!/bin/bash /usr/bin/qemu-system-x86_64 \     -display none -vga none \     -name guest=simple_vm,debug-threads=on \     -monitor stdio

Re: [PATCH v7 3/3] cpus-common: implement dirty page limit on vCPU

2021-11-30 Thread Hyman Huang
vcpu. When $cpu is not specified, we return an array of that containing all the vcpus. It'll be nicer to enhance the output of the query command to e.g. have a global "enabled"=true/false as long as any vcpu has throttle enabled then the global throttle is enabled. I didn't think more than that, but how's that sound so far? Soud good, it makes the command easier for programmers to use and understand, i'll try this out next version. Thanks, -- Best Regards Hyman Huang(黄勇)

Re: [PATCH v7 0/3] support dirty restraint on vCPU

2021-11-30 Thread Hyman Huang
ess binary, which compiled from qemu source tests/migration/stress.c and run as init in vm. you can view README.md file of my project "met"(https://github.com/newfriday/met) to compile the initrd-stress.img. :) On 11/30/21 20:57, Peter Xu wrote: On Tue, Nov 30, 2021 at 06:28:10PM +08

Re: [PATCH v10 2/3] cpu-throttle: implement virtual CPU throttle

2021-12-15 Thread Hyman Huang
在 2021/12/15 15:15, Markus Armbruster 写道: huang...@chinatelecom.cn writes: From: Hyman Huang(黄勇) Setup a negative feedback system when vCPU thread handling KVM_EXIT_DIRTY_RING_FULL exit by introducing throttle_us_per_full field in struct CPUState. Sleep throttle_us_per_full microseconds

Re: [PATCH v10 3/3] cpus-common: implement dirty page limit on virtual CPU

2021-12-15 Thread Hyman Huang
在 2021/12/15 15:37, Markus Armbruster 写道: huang...@chinatelecom.cn writes: From: Hyman Huang(黄勇) Implement dirtyrate calculation periodically basing on dirty-ring and throttle virtual CPU until it reachs the quota dirty page rate given by user. Introduce qmp commands "vcpu-dirty-

Re: [PATCH v10 3/3] cpus-common: implement dirty page limit on virtual CPU

2021-12-15 Thread Hyman Huang
在 2021/12/15 16:09, Peter Xu 写道: On Wed, Dec 15, 2021 at 03:56:55PM +0800, Hyman Huang wrote: +{ 'command': 'vcpu-dirty-limit', + 'data': { 'enable': 'bool', +'*cpu-index': 'uint64', +'*dirty-rate': 'uint64'} } Drop @enable, please. If @dirty-rate is present, set

Re: [PATCH v10 3/3] cpus-common: implement dirty page limit on virtual CPU

2021-12-15 Thread Hyman Huang
在 2021/12/15 16:29, Hyman Huang 写道: 在 2021/12/15 16:09, Peter Xu 写道: On Wed, Dec 15, 2021 at 03:56:55PM +0800, Hyman Huang wrote: +{ 'command': 'vcpu-dirty-limit', +  'data': { 'enable': 'bool', +    '*cpu-index': 'uint64', +    '*dirty-rate': 'uint64'} } Drop @enable

Re: [PATCH v10 2/3] cpu-throttle: implement virtual CPU throttle

2022-01-13 Thread Hyman Huang
在 2022/1/14 0:22, Markus Armbruster 写道: Peter Xu writes: On Fri, Dec 31, 2021 at 12:36:40AM +0800, Hyman Huang wrote: +struct { +DirtyLimitState *states; +int max_cpus; +unsigned long *bmap; /* running thread bitmap */ +unsigned long nr; +QemuThread thread

Re: [PATCH v11 3/4] softmmu/dirtylimit: implement virtual CPU throttle

2022-01-17 Thread Hyman Huang
dirtylimit_state_unlock(); } I didn't write the cleanup path, but it's the same: we should only cleanup all the global structs in cancel-vcpu-dirty-limit when we found there's zero vcpus in track, and it should be done once there. Thanks, Sound good. -- Best Regards Hyman Huang(黄勇)

Re: [PATCH v20 8/9] migration-test: Export migration-test util funtions

2022-03-16 Thread Hyman Huang
ty ring test; so far only x86_64 is supported */ +#if defined(__linux__) && defined(HOST_X86_64) +#include "linux/kvm.h" +#endif +#include + extern bool got_stop; +extern const char *tmpfs; -- Best regard Hyman Huang(黄勇)

Re: [PATCH v15 0/7] support dirty restraint on vCPU

2022-02-15 Thread Hyman Huang
在 2022/2/16 15:42, Peter Xu 写道: On Wed, Feb 16, 2022 at 12:13:31PM +0800, huang...@chinatelecom.cn wrote: From: Hyman Huang(黄勇) v15 - rebase on master - drop the 'init_time_ms' parameter in function vcpu_calculate_dirtyrate - drop the 'setup' field in dirtylimit_state and call

Re: [PATCH] migration: Introduce dirtylimit capability

2022-03-03 Thread Hyman Huang
"Sent by accident, please ignore, I'll send v1 when ready." 在 2022/3/3 18:45, huang...@chinatelecom.cn 写道: From: Hyman Huang(黄勇) Signed-off-by: Hyman Huang(黄勇) --- migration/migration.c | 19 +++ migration/migration.h | 1 + migration/ram.c

Re: [PATCH v18 7/7] softmmu/dirtylimit: Implement dirty page rate limit

2022-03-03 Thread Hyman Huang
在 2022/3/3 20:02, Markus Armbruster 写道: huang...@chinatelecom.cn writes: From: Hyman Huang(黄勇) Implement dirtyrate calculation periodically basing on dirty-ring and throttle virtual CPU until it reachs the quota dirty page rate given by user. Introduce qmp commands "set-vcpu-dirty-

Re: [PATCH v17 8/8] tests/qtest/qmp-cmd-test: Ignore query-vcpu-dirty-limit test

2022-03-02 Thread Hyman Huang
在 2022/3/3 13:58, Markus Armbruster 写道: huang...@chinatelecom.cn writes: From: Hyman Huang(黄勇) query-vcpu-dirty-limit success depends on enabling dirty page rate limit, so just add it to the list of skipped command to ensure qmp-cmd-test run successfully. Signed-off-by: Hyman Huang(黄勇

Re: [PATCH v14 3/7] migration/dirtyrate: Refactor dirty page rate calculation

2022-02-14 Thread Hyman Huang
); -dirtyrate_global_dirty_log_stop(); - -CPU_FOREACH(cpu) { -record_dirtypages(dirty_pages, cpu, false); -} +DirtyStat.calc_time = duration / 1000; -- Best regard Hyman Huang(黄勇)

Re: [PATCH v14 6/7] softmmu/dirtylimit: Implement virtual CPU throttle

2022-02-14 Thread Hyman Huang
How about wrapping the trace into dirtylimit_vcpu_set_quota, then drop it? Ok. Thanks, -- Best regard Hyman Huang(黄勇)

Re: [PATCH v14 7/7] softmmu/dirtylimit: Implement dirty page rate limit

2022-02-14 Thread Hyman Huang
ate(index)->enabled) { +info = dirtylimit_query_vcpu(index); +QAPI_LIST_APPEND(tail, info); +} +} + +dirtylimit_state_unlock(); + +return head; +} -- Best regard Hyman Huang(黄勇)

Re: [PATCH v14 6/7] softmmu/dirtylimit: Implement virtual CPU throttle

2022-02-14 Thread Hyman Huang
bool enable) +{ +dirtylimit_vcpu_set_quota(cpu_index, quota, enable); +trace_dirtylimit_set_vcpu(cpu_index, quota); +} This helper is not "help"ful.. How about wrapping the trace into dirtylimit_vcpu_set_quota, then drop it? Thanks, -- Best regard Hyman Huang(黄勇)

Re: [PATCH v21 0/9] support dirty restraint on vCPU

2022-03-21 Thread Hyman Huang
写道: From: Hyman Huang(黄勇) v21 - remove the tmpfs declarations in header file and test case should use tmpfs as internal var respectively. v20 - fix the style problems and let QEMU test pass - change the dirty limit case logic: test fail if dirtyrate measurement 200ms timeout v19 - rebase

Re: [PATCH v1 1/5] kvm,memory: Optimize dirty page collection for dirty ring

2022-03-22 Thread Hyman Huang
ove from the common logic and implemented somewhere else, i havn't think it through yet. } } } -- Best regard Hyman Huang(黄勇)

Re: [PATCH v2] tests/migration: Introduce dirty-ring-size option into guestperf

2022-03-23 Thread Hyman Huang
Ping. Hi, what do you think of this patch. 在 2022/3/16 21:39, huang...@chinatelecom.cn 写道: From: Hyman Huang(黄勇) Guestperf tool does not enable diry ring feature when test migration by default. To support dirty ring migration performance test, introduce dirty-ring-size option into guestperf

Re: [PATCH v2] tests/migration: Introduce dirty-ring-size option into guestperf

2022-04-01 Thread Hyman Huang
...@chinatelecom.cn 写道: From: Hyman Huang(黄勇) Guestperf tool does not enable diry ring feature when test migration by default. To support dirty ring migration performance test, introduce dirty-ring-size option into guestperf tools, which ranges in [1024, 65536]. To set dirty ring size with 4096 during migration

Re: [PATCH v2 1/4] kvm: Dynamically adjust the rate of dirty ring reaper thread

2022-04-02 Thread Hyman Huang
ndex); qemu_mutex_lock_iothread(); kvm_dirty_ring_reap(kvm_state); +kvm_state->reaper.ring_full_cnt++; qemu_mutex_unlock_iothread(); ret = 0; break; Thanks. -- Best regard Hyman Huang(黄勇)

Re: [PATCH v2 2/4] kvm: Dirty ring autoconverge optmization for kvm_cpu_synchronize_kick_all

2022-04-02 Thread Hyman Huang
} +} For the code style itself, IMHO, exporting helpers should split into a standalone commit. -- Best regard Hyman Huang(黄勇)

Re: [PATCH v2 3/4] kvm: Introduce a dirty rate calculation method based on dirty ring

2022-04-02 Thread Hyman Huang
bool kvm_arch_cpu_check_are_resettable(void); bool kvm_dirty_ring_enabled(void); +int64_t kvm_dirty_ring_get_rate(void); +int64_t kvm_dirty_ring_get_peak_rate(void); #endif -- Best regard Hyman Huang(黄勇)

Re: [PATCH v12 4/5] softmmu/dirtylimit: implement virtual CPU throttle

2022-02-08 Thread Hyman Huang
在 2022/2/8 16:59, Peter Xu 写道: On Mon, Jan 24, 2022 at 10:10:39PM +0800, huang...@chinatelecom.cn wrote: From: Hyman Huang(黄勇) Setup a negative feedback system when vCPU thread handling KVM_EXIT_DIRTY_RING_FULL exit by introducing throttle_us_per_full field in struct CPUState. Sleep

Re: [PATCH v12 1/5] accel/kvm/kvm-all: refactor per-vcpu dirty ring reaping

2022-02-08 Thread Hyman Huang
ill be expensive, so ideally we can still try the best to reap as much PFNs as possible, as long as we still don't need accuracy on RING_FULL exit events. qemu_mutex_unlock_iothread(); ret = 0; break; -- 1.8.3.1 -- Best regard Hyman Huang(黄勇)

Re: [PATCH v12 2/5] migration/dirtyrate: refactor dirty page rate calculation

2022-02-08 Thread Hyman Huang
INA TELECOM CO.,LTD. + * + * Authors: + * Hyman Huang(黄勇) + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#ifndef QEMU_DIRTYRATE_H +#define QEMU_DIRTYRATE_H + +extern unsigned int cpu_list_generation_id;

Re: [PATCH v11 3/4] softmmu/dirtylimit: implement virtual CPU throttle

2022-01-17 Thread Hyman Huang
在 2022/1/18 9:00, Peter Xu 写道: On Mon, Jan 17, 2022 at 10:00:57PM +0800, Hyman Huang wrote: This algorithm seems works even worse than the previous version, could you have a look on what's wrong? What number the dirty-ring-size of qemu be configured? is it the same as previous version test

Re: [PATCH v11 3/4] softmmu/dirtylimit: implement virtual CPU throttle

2022-01-21 Thread Hyman Huang
x) { dirtylimit_set_vcpu(cpu_index, dirty_rate, true); } else { dirtylimit_set_all(dirty_rate, true); } dirtylimit_state_unlock(); } I didn't write the cleanup path, but it's the same: we should only cleanup all the global structs in cancel-vcpu-dirty-limit when we found there's zero vcpus in track, and it should be done once there. Thanks, -- Best regard Hyman Huang(黄勇)

Re: [PATCH v11 1/4] migration/dirtyrate: refactor dirty page rate calculation

2022-01-21 Thread Hyman Huang
在 2022/1/17 10:19, Peter Xu 写道: On Wed, Jan 05, 2022 at 01:14:06AM +0800, huang...@chinatelecom.cn wrote: From: Hyman Huang(黄勇) + +static void vcpu_dirty_stat_collect(VcpuStat *stat, +DirtyPageRecord *records, +bool

Re: [PATCH v11 3/4] softmmu/dirtylimit: implement virtual CPU throttle

2022-01-21 Thread Hyman Huang
continue; +} +dirtylimit_adjust_throttle(cpu); +} +dirtylimit_state_unlock(); +} + +rcu_unregister_thread(); + +return NULL; +} + -- Best regard Hyman Huang(黄勇)

Re: [PATCH v11 3/4] softmmu/dirtylimit: implement virtual CPU throttle

2022-01-20 Thread Hyman Huang
rtylimit_vcpu_set_quota(cpu_index, quota, true); } if (has_cpu_index) { dirtylimit_set_vcpu(cpu_index, dirty_rate, true); } else { dirtylimit_set_all(dirty_rate, true); } dirtylimit_state_unlock(); } I didn't write the cleanup path, but it's the same: we should only cleanup all the global structs in cancel-vcpu-dirty-limit when we found there's zero vcpus in track, and it should be done once there. Thanks, -- Best regard Hyman Huang(黄勇)

Re: [PATCH v11 3/4] softmmu/dirtylimit: implement virtual CPU throttle

2022-01-20 Thread Hyman Huang
在 2022/1/20 17:25, Peter Xu 写道: On Thu, Jan 20, 2022 at 04:26:09PM +0800, Hyman Huang wrote: Hi,Peter. I'm working on this problem and found the reason is kind of the same as i metioned in cover letter of v10, the following is what i posted: 2. The new implementaion of throttle algo

Re: [PATCH v11 3/4] softmmu/dirtylimit: implement virtual CPU throttle

2022-01-20 Thread Hyman Huang
在 2022/1/20 18:56, Peter Xu 写道: On Thu, Jan 20, 2022 at 06:39:01PM +0800, Hyman Huang wrote: It only runs once per second so it shouldn't bring a lot of differences, but I'm also wondering whether we should also turn that temporarily off too when dirtylimit is enabled - we can simply let

Re: [PATCH v11 3/4] softmmu/dirtylimit: implement virtual CPU throttle

2022-01-20 Thread Hyman Huang
在 2022/1/19 20:16, Markus Armbruster 写道: huang...@chinatelecom.cn writes: From: Hyman Huang(黄勇) Setup a negative feedback system when vCPU thread handling KVM_EXIT_DIRTY_RING_FULL exit by introducing throttle_us_per_full field in struct CPUState. Sleep throttle_us_per_full microseconds

Re: [PATCH v11 3/4] softmmu/dirtylimit: implement virtual CPU throttle

2022-01-20 Thread Hyman Huang
of this patch, so it can be reviewed easier outside of dirtylimit details. Thanks, -- Best regard Hyman Huang(黄勇)

Re: [PATCH v11 3/4] softmmu/dirtylimit: implement virtual CPU throttle

2022-01-23 Thread Hyman Huang
_set_all(dirty_rate, true); } dirtylimit_state_unlock(); } I didn't write the cleanup path, but it's the same: we should only cleanup all the global structs in cancel-vcpu-dirty-limit when we found there's zero vcpus in track, and it should be done once there. Thanks, -- Best regard Hyman Huang(黄勇)

Re: [PATCH v11 1/4] migration/dirtyrate: refactor dirty page rate calculation

2022-01-24 Thread Hyman Huang
在 2022/1/24 11:08, Peter Xu 写道: On Sat, Jan 22, 2022 at 11:22:37AM +0800, Hyman Huang wrote: 在 2022/1/17 10:19, Peter Xu 写道: On Wed, Jan 05, 2022 at 01:14:06AM +0800, huang...@chinatelecom.cn wrote: From: Hyman Huang(黄勇) + +static void vcpu_dirty_stat_collect(VcpuStat *stat

[PULL 2/3] softmmu/dirtylimit: Convert free to g_free

2023-08-28 Thread Hyman Huang
lloc.young Reviewed-by: Hyman Huang Reviewed-by: Philippe Mathieu-Daudé Message-Id: Signed-off-by: Hyman Huang --- softmmu/dirtylimit.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/softmmu/dirtylimit.c b/softmmu/dirtylimit.c index e3ff53b8fc..fa959d7743 100

[PULL 3/3] migration/dirtyrate: Fix precision losses and g_usleep overshoot

2023-08-28 Thread Hyman Huang
From: Andrei Gudkov Signed-off-by: Andrei Gudkov Reviewed-by: Hyman Huang Message-Id: <8ddb0d40d143f77aab8f602bd494e01e5fa01614.1691161009.git.gudkov.and...@huawei.com> Signed-off-by: Hyman Huang --- migration/dirtyrate.c | 10 -- 1 file changed, 8 insertions(+), 2 del

[PULL 0/3] Dirty page rate and dirty page limit 20230829 patches

2023-08-28 Thread Hyman Huang
Merge tag 'pull-target-arm-20230824' of https://git.linaro.org/people/pmaydell/qemu-arm into staging (2023-08-24 10:08:33 -0400) are available in the Git repository at: https://github.com/newfriday/qemu.git tags/dirtylimit-dirtyrate-fixes-pull-request for you to fetch changes up to

[PULL 1/3] softmmu: Fix dirtylimit memory leak

2023-08-28 Thread Hyman Huang
From: "alloc.young" Fix memory leak in hmp_info_vcpu_dirty_limit,use g_autoptr to handle memory deallocation. Signed-off-by: alloc.young Reviewed-by: Hyman Huang Message-Id: Signed-off-by: Hyman Huang --- softmmu/dirtylimit.c | 16 +++- 1 file changed, 7 insert

[PULL 0/3] Dirty page rate and dirty page limit 20230828 patches

2023-08-28 Thread Hyman Huang
From: Hyman The following changes since commit 50e7a40af372ee5931c99ef7390f5d3d6fbf6ec4: Merge tag 'pull-target-arm-20230824' of https://git.linaro.org/people/pmaydell/qemu-arm into staging (2023-08-24 10:08:33 -0400) are available in the git repository at:

Re: [PATCH] softmmu/dirtylimit: Fix usleep early return on signal

2023-10-16 Thread Hyman Huang
在 2023/9/5 10:17, alloc young 写道: On 2023/9/4 21:27, Yong Huang wrote: On Fri, Sep 1, 2023 at 10:19 AM > wrote:     From: alloc >     Timeout functions like usleep can return early on signal, which reduces     more

[PATCH 6/6] docs/migration: Add the dirty limit section

2023-10-17 Thread Hyman Huang
The dirty limit feature has been introduced since the 8.1 QEMU release but has not reflected in the document, add a section for that. Signed-off-by: Hyman Huang --- docs/devel/migration.rst | 71 1 file changed, 71 insertions(+) diff --git a/docs/devel

[PATCH 3/6] tests: Add migration dirty-limit capability test

2023-10-17 Thread Hyman Huang
. Note that this test case involves many passes, so it runs in slow mode only. Signed-off-by: Hyman Huang Acked-by: Peter Xu --- tests/qtest/migration-test.c | 164 +++ 1 file changed, 164 insertions(+) diff --git a/tests/qtest/migration-test.c b/tests/qtest

[PATCH 1/6] system/dirtylimit: Fix a race situation

2023-10-17 Thread Hyman Huang
Fix a race situation for global variable dirtylimit_state. Also, replace usleep by g_usleep to increase platform accessibility to the sleep function. Signed-off-by: Hyman Huang --- system/dirtylimit.c | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git

[PATCH 0/6] dirtylimit: miscellaneous patches

2023-10-17 Thread Hyman Huang
: add dirtylimit section. Please review, thanks. Regards, Yong Hyman Huang (6): system/dirtylimit: Fix a race situation system/dirtylimit: Drop the reduplicative check tests: Add migration dirty-limit capability test tests/migration: Introduce dirty-ring-size option into guestperf

[PATCH 2/6] system/dirtylimit: Drop the reduplicative check

2023-10-17 Thread Hyman Huang
Checking if dirty limit is in service is done by the dirtylimit_query_all function, drop the reduplicative check in the qmp_query_vcpu_dirty_limit function. Signed-off-by: Hyman Huang --- system/dirtylimit.c | 4 1 file changed, 4 deletions(-) diff --git a/system/dirtylimit.c b/system

[PATCH 4/6] tests/migration: Introduce dirty-ring-size option into guestperf

2023-10-17 Thread Hyman Huang
-ring-size 4096 xxx Signed-off-by: Hyman Huang --- tests/migration/guestperf/engine.py | 6 +- tests/migration/guestperf/hardware.py | 8 ++-- tests/migration/guestperf/shell.py| 6 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/migration/guestperf

[PATCH 5/6] tests/migration: Introduce dirty-limit into guestperf

2023-10-17 Thread Hyman Huang
--transport unix \ --filter compr-dirty-limit* --output outputdir Signed-off-by: Hyman Huang --- tests/migration/guestperf/comparison.py | 23 +++ tests/migration/guestperf/engine.py | 17 + tests/migration/guestperf/progress.py | 16

Re: [v2 4/6] tests/migration: Introduce dirty-ring-size option into guestperf

2023-10-27 Thread Hyman Huang
to that. On Fri, Oct 20, 2023 at 11:24 PM Hyman Huang wrote: Dirty ring size configuration is not supported by guestperf tool. Introduce dirty-ring-size (ranges in [1024, 65536]) option so developers can play with dirty-ring and dirty-limit feature easier. To set dirty ring

[v3 0/6] dirtylimit: miscellaneous patches

2023-11-01 Thread Hyman Huang
case. 3. guestperf for migration: add support for dirtylimit migration. 4. docs for migration: add dirtylimit section. Please review, thanks. Regards, Hyman Huang (6): system/dirtylimit: Fix a race situation system/dirtylimit: Drop the reduplicative check tests: Add migration dirty-limit

[v3 3/6] tests: Add migration dirty-limit capability test

2023-11-01 Thread Hyman Huang
. Note that this test case involves many passes, so it runs in slow mode only. Signed-off-by: Hyman Huang Acked-by: Peter Xu Reviewed-by: Fabiano Rosas Message-Id: --- tests/qtest/migration-test.c | 164 +++ 1 file changed, 164 insertions(+) diff --git a/tests

[v3 2/6] system/dirtylimit: Drop the reduplicative check

2023-11-01 Thread Hyman Huang
Checking if dirty limit is in service is done by the dirtylimit_query_all function, drop the reduplicative check in the qmp_query_vcpu_dirty_limit function. Signed-off-by: Hyman Huang Reviewed-by: Fabiano Rosas Message-Id: <31384f768279027560ab952ebc2bbff1ddb62531.1697815117.git.yong

[v3 1/6] system/dirtylimit: Fix a race situation

2023-11-01 Thread Hyman Huang
Fix a race situation for global variable dirtylimit_state. Also, replace usleep by g_usleep to increase platform accessibility to the sleep function. Signed-off-by: Hyman Huang Reviewed-by: Fabiano Rosas Message-Id: --- system/dirtylimit.c | 20 ++-- 1 file changed, 14

[v3 4/6] tests/migration: Introduce dirty-ring-size option into guestperf

2023-11-01 Thread Hyman Huang
-ring-size 4096 xxx Signed-off-by: Hyman Huang Reviewed-by: Fabiano Rosas Message-Id: --- tests/migration/guestperf/engine.py | 6 +- tests/migration/guestperf/hardware.py | 8 ++-- tests/migration/guestperf/shell.py| 6 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff

[v3 6/6] docs/migration: Add the dirty limit section

2023-11-01 Thread Hyman Huang
The dirty limit feature has been introduced since the 8.1 QEMU release but has not reflected in the document, add a section for that. Signed-off-by: Hyman Huang Reviewed-by: Fabiano Rosas Message-Id: <36194a8a23d937392bf13d9fff8e898030c827a3.1697815117.git.yong.hu...@smartx.com> ---

[v3 5/6] tests/migration: Introduce dirty-limit into guestperf

2023-11-01 Thread Hyman Huang
--transport unix \ --filter compr-dirty-limit* --output outputdir Signed-off-by: Hyman Huang Reviewed-by: Fabiano Rosas Message-Id: <516e7a55dfc6e33d33510be37eb24223de5dc072.1697815117.git.yong.hu...@smartx.com> --- tests/migration/guestperf/comparison.py | 23 +++

[PULL 2/2] migration/dirtyrate: use QEMU_CLOCK_HOST to report start-time

2023-10-09 Thread Hyman Huang
whether previously completed measurements are too old or not. But this makes sense only if start-time is reported as host wall-clock time. This patch replaces source of start-time from QEMU_CLOCK_REALTIME to QEMU_CLOCK_HOST. Signed-off-by: Andrei Gudkov Reviewed-by: Hyman Huang Message-Id

[PULL 1/2] migration/calc-dirty-rate: millisecond-granularity period

2023-10-09 Thread Hyman Huang
s are computed according to the following formula: size * (1 - (1-(4096/size))^(time*wps)) / (time * 2^20), where size is in bytes, time is in seconds, and wps is number of writes per second. Signed-off-by: Andrei Gudkov Reviewed-by: Hyman Huang Message-Id:

[PULL 0/2] Dirty page rate and dirty page limit 20231009 patches

2023-10-09 Thread Hyman Huang
The following changes since commit 2f3913f4b2ad74baeb5a6f1d36efbd9ecdf1057d: Merge tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu into staging (2023-10-05 09:01:01 -0400) are available in the Git repository at: https://github.com/newfriday/qemu.git

[v2 0/6] dirtylimit: miscellaneous patches

2023-10-20 Thread Hyman Huang
support for dirtylimit migration. 4. docs for migration: add dirtylimit section. Please review, thanks. Regards, Yong Hyman Huang (6): system/dirtylimit: Fix a race situation system/dirtylimit: Drop the reduplicative check tests: Add migration dirty-limit capability test tests/migration

[v2 5/6] tests/migration: Introduce dirty-limit into guestperf

2023-10-20 Thread Hyman Huang
--transport unix \ --filter compr-dirty-limit* --output outputdir Signed-off-by: Hyman Huang --- tests/migration/guestperf/comparison.py | 23 +++ tests/migration/guestperf/engine.py | 17 + tests/migration/guestperf/progress.py | 16

[v2 3/6] tests: Add migration dirty-limit capability test

2023-10-20 Thread Hyman Huang
. Note that this test case involves many passes, so it runs in slow mode only. Signed-off-by: Hyman Huang Acked-by: Peter Xu Reviewed-by: Fabiano Rosas --- tests/qtest/migration-test.c | 164 +++ 1 file changed, 164 insertions(+) diff --git a/tests/qtest

[v2 6/6] docs/migration: Add the dirty limit section

2023-10-20 Thread Hyman Huang
The dirty limit feature has been introduced since the 8.1 QEMU release but has not reflected in the document, add a section for that. Signed-off-by: Hyman Huang --- docs/devel/migration.rst | 71 1 file changed, 71 insertions(+) diff --git a/docs/devel

  1   2   3   >