qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Peter Xu
Subject: Re: [PATCH v14 3/7] migration/dirtyrate: Refactor dirty page rate calculation
Date: Mon, 14 Feb 2022 15:57:31 +0800

Mostly good, one trivial nit below:

On Fri, Feb 11, 2022 at 12:17:37AM +0800, huangy81@chinatelecom.cn wrote:
> +int64_t vcpu_calculate_dirtyrate(int64_t calc_time_ms,
> +                                 int64_t init_time_ms,
> +                                 VcpuStat *stat,
> +                                 unsigned int flag,
> +                                 bool one_shot)
> +{
> +    DirtyPageRecord *records;
> +    int64_t duration;
> +    int64_t dirtyrate;
> +    int i = 0;
> +    unsigned int gen_id;
> +
> +retry:
> +    cpu_list_lock();
> +    gen_id = cpu_list_generation_id_get();
> +    records = vcpu_dirty_stat_alloc(stat);
> +    vcpu_dirty_stat_collect(stat, records, true);
> +    cpu_list_unlock();
> +
> +    duration = dirty_stat_wait(calc_time_ms, init_time_ms);

Is it a must to pass in init_time_ms rather than always sleep in
dirty_stat_wait()?  Could we simply drop it?

-- 
Peter Xu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]