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

2022-02-14 Thread Peter Xu
On Mon, Feb 14, 2022 at 05:05:38PM +0800, Hyman Huang wrote: > But i'm ok if you insist because it's just about how to call the > 'dirtylimit' and doesn't affect the whole logic. If you don't have plan to add e.g. another adjust() method then it's pointless. The hook can be easily added on top whe

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

2022-02-14 Thread Hyman Huang
在 2022/2/14 16:20, Peter Xu 写道: On Fri, Feb 11, 2022 at 12:17:40AM +0800, huang...@chinatelecom.cn wrote: @@ -2964,8 +2971,13 @@ int kvm_cpu_exec(CPUState *cpu) */ trace_kvm_dirty_ring_full(cpu->cpu_index); qemu_mutex_lock_iothread(); -kv

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

2022-02-14 Thread Hyman Huang
在 2022/2/14 16:20, Peter Xu 写道: On Fri, Feb 11, 2022 at 12:17:40AM +0800, huang...@chinatelecom.cn wrote: @@ -2964,8 +2971,13 @@ int kvm_cpu_exec(CPUState *cpu) */ trace_kvm_dirty_ring_full(cpu->cpu_index); qemu_mutex_lock_iothread(); -kv

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

2022-02-14 Thread Peter Xu
On Fri, Feb 11, 2022 at 12:17:40AM +0800, huang...@chinatelecom.cn wrote: > @@ -2964,8 +2971,13 @@ int kvm_cpu_exec(CPUState *cpu) > */ > trace_kvm_dirty_ring_full(cpu->cpu_index); > qemu_mutex_lock_iothread(); > -kvm_dirty_ring_reap(kvm_state, NU

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

2022-02-10 Thread huangy81
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 to throttle vCPU if dirtylimit is in service. Signed-off-by: Hyman Huang(黄勇) ---