All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: huangy81@chinatelecom.cn
Cc: "Eduardo Habkost" <eduardo@habkost.net>,
	"David Hildenbrand" <david@redhat.com>,
	"Juan Quintela" <quintela@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	qemu-devel <qemu-devel@nongnu.org>,
	"Markus ArmBruster" <armbru@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [PATCH v14 3/7] migration/dirtyrate: Refactor dirty page rate calculation
Date: Mon, 14 Feb 2022 15:57:31 +0800	[thread overview]
Message-ID: <YgoLa4B7Eq8OOJq7@xz-m1.local> (raw)
In-Reply-To: <5984c1faf2de00df1a4add819fdab5cbe4014746.1644509582.git.huangy81@chinatelecom.cn>

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	other threads:[~2022-02-14  8:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10 16:17 [PATCH v14 0/7] support dirty restraint on vCPU huangy81
2022-02-10 16:17 ` [PATCH v14 1/7] accel/kvm/kvm-all: Refactor per-vcpu dirty ring reaping huangy81
2022-02-14  7:57   ` Peter Xu
2022-02-10 16:17 ` [PATCH v14 2/7] cpus: Introduce cpu_list_generation_id huangy81
2022-02-14  7:59   ` Peter Xu
2022-02-10 16:17 ` [PATCH v14 3/7] migration/dirtyrate: Refactor dirty page rate calculation huangy81
2022-02-14  7:57   ` Peter Xu [this message]
2022-02-14  8:40     ` Hyman Huang
2022-02-14  9:47       ` Peter Xu
2022-02-10 16:17 ` [PATCH v14 4/7] softmmu/dirtylimit: Implement vCPU dirtyrate calculation periodically huangy81
2022-02-14  8:01   ` Peter Xu
2022-02-10 16:17 ` [PATCH v14 5/7] accel/kvm/kvm-all: Introduce kvm_dirty_ring_size function huangy81
2022-02-14  8:02   ` Peter Xu
2022-02-10 16:17 ` [PATCH v14 6/7] softmmu/dirtylimit: Implement virtual CPU throttle huangy81
2022-02-14  8:20   ` Peter Xu
2022-02-14  9:05     ` Hyman Huang
2022-02-14  9:51       ` Peter Xu
2022-02-14  9:22     ` Hyman Huang
2022-02-10 16:17 ` [PATCH v14 7/7] softmmu/dirtylimit: Implement dirty page rate limit huangy81
2022-02-11 13:40   ` Markus Armbruster
2022-02-14  8:25   ` Peter Xu
2022-02-14  9:24     ` Hyman Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YgoLa4B7Eq8OOJq7@xz-m1.local \
    --to=peterx@redhat.com \
    --cc=armbru@redhat.com \
    --cc=david@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=huangy81@chinatelecom.cn \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.