From: Juan Quintela <quintela@redhat.com>
To: mrhines@linux.vnet.ibm.com
Cc: GILR@il.ibm.com, SADEKJ@il.ibm.com, pbonzini@redhat.com,
qemu-devel@nongnu.org, EREZH@il.ibm.com, owasserm@redhat.com,
junqing.wang@cs2c.com.cn, onom@us.ibm.com, hinesmr@cn.ibm.com,
isaku.yamahata@gmail.com, gokul@us.ibm.com, dbulkow@gmail.com,
abali@us.ibm.com, BIRAN@il.ibm.com, lig.fnst@cn.fujitsu.com,
"Michael R. Hines" <mrhines@us.ibm.com>
Subject: Re: [Qemu-devel] [RFC PATCH v2 02/12] mc: timestamp migration_bitmap and KVM logdirty usage
Date: Tue, 11 Mar 2014 22:31:11 +0100 [thread overview]
Message-ID: <87a9cw1kyo.fsf@elfo.mitica> (raw)
In-Reply-To: <1392713429-18201-3-git-send-email-mrhines@linux.vnet.ibm.com> (mrhines@linux.vnet.ibm.com's message of "Tue, 18 Feb 2014 16:50:19 +0800")
mrhines@linux.vnet.ibm.com wrote:
> From: "Michael R. Hines" <mrhines@us.ibm.com>
>
> We also later export these statistics over QMP for better
> monitoring of micro-checkpointing as the workload changes.
>
> Signed-off-by: Michael R. Hines <mrhines@us.ibm.com>
> ---
> arch_init.c | 34 ++++++++++++++++++++++++++++------
> 1 file changed, 28 insertions(+), 6 deletions(-)
>
> diff --git a/arch_init.c b/arch_init.c
> index 80574a0..b8364b0 100644
> --- a/arch_init.c
> +++ b/arch_init.c
> @@ -193,6 +193,8 @@ typedef struct AccountingInfo {
> uint64_t skipped_pages;
> uint64_t norm_pages;
> uint64_t iterations;
> + uint64_t log_dirty_time;
> + uint64_t migration_bitmap_time;
> uint64_t xbzrle_bytes;
> uint64_t xbzrle_pages;
> uint64_t xbzrle_cache_miss;
> @@ -201,7 +203,7 @@ typedef struct AccountingInfo {
>
> static AccountingInfo acct_info;
>
> -static void acct_clear(void)
> +void acct_clear(void)
> {
> memset(&acct_info, 0, sizeof(acct_info));
> }
> @@ -236,6 +238,16 @@ uint64_t norm_mig_pages_transferred(void)
> return acct_info.norm_pages;
> }
>
> +uint64_t norm_mig_log_dirty_time(void)
> +{
> + return acct_info.log_dirty_time;
> +}
> +
> +uint64_t norm_mig_bitmap_time(void)
> +{
> + return acct_info.migration_bitmap_time;
> +}
> +
> uint64_t xbzrle_mig_bytes_transferred(void)
> {
> return acct_info.xbzrle_bytes;
> @@ -426,27 +438,35 @@ static void migration_bitmap_sync(void)
> static int64_t num_dirty_pages_period;
> int64_t end_time;
> int64_t bytes_xfer_now;
> + int64_t begin_time;
> + int64_t dirty_time;
>
> if (!bytes_xfer_prev) {
> bytes_xfer_prev = ram_bytes_transferred();
> }
>
> + begin_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
> if (!start_time) {
> start_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
> }
if (!start_time) {
start_time = begin_time;
}
Althought I think we need to search for better names?
start_time --> migration_start_time
begin_time --> iteration_start_time
?
I am open to better names.
> -
> trace_migration_bitmap_sync_start();
> address_space_sync_dirty_bitmap(&address_space_memory);
>
> + dirty_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
> +
> QTAILQ_FOREACH(block, &ram_list.blocks, next) {
> migration_bitmap_sync_range(block->mr->ram_addr, block->length);
> }
> +
> trace_migration_bitmap_sync_end(migration_dirty_pages
> - num_dirty_pages_init);
> num_dirty_pages_period += migration_dirty_pages - num_dirty_pages_init;
> end_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
>
> - /* more than 1 second = 1000 millisecons */
> + acct_info.log_dirty_time += dirty_time - begin_time;
> + acct_info.migration_bitmap_time += end_time - dirty_time;
> +
> + /* more than 1 second = 1000 milliseconds */
> if (end_time > start_time + 1000) {
> if (migrate_auto_converge()) {
> /* The following detection logic can be refined later. For now:
> @@ -548,9 +568,11 @@ static int ram_save_block(QEMUFile *f, bool last_stage)
> /* XBZRLE overflow or normal page */
> if (bytes_sent == -1) {
> bytes_sent = save_block_hdr(f, block, offset, cont, RAM_SAVE_FLAG_PAGE);
> - qemu_put_buffer_async(f, p, TARGET_PAGE_SIZE);
> - bytes_sent += TARGET_PAGE_SIZE;
> - acct_info.norm_pages++;
> + if (ret != RAM_SAVE_CONTROL_DELAYED) {
> + qemu_put_buffer_async(f, p, TARGET_PAGE_SIZE);
> + bytes_sent += TARGET_PAGE_SIZE;
> + acct_info.norm_pages++;
> + }
> }
>
> /* if page is unmodified, continue to the next */
Except for this bit, rest of the patch ok.
next prev parent reply other threads:[~2014-03-11 21:31 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-18 8:50 [Qemu-devel] [RFC PATCH v2 00/12] mc: fault tolerante through micro-checkpointing mrhines
2014-02-18 8:50 ` [Qemu-devel] [RFC PATCH v2 01/12] mc: add documentation for micro-checkpointing mrhines
2014-02-18 12:45 ` Dr. David Alan Gilbert
2014-02-19 1:40 ` Michael R. Hines
2014-02-19 11:27 ` Dr. David Alan Gilbert
2014-02-20 1:17 ` Michael R. Hines
2014-02-20 10:09 ` Dr. David Alan Gilbert
2014-02-20 11:14 ` Li Guang
2014-02-20 14:58 ` Michael R. Hines
2014-02-20 14:57 ` Michael R. Hines
2014-02-20 16:32 ` Dr. David Alan Gilbert
2014-02-21 4:54 ` Michael R. Hines
2014-02-21 9:44 ` Dr. David Alan Gilbert
2014-03-03 6:08 ` Michael R. Hines
2014-02-18 8:50 ` [Qemu-devel] [RFC PATCH v2 02/12] mc: timestamp migration_bitmap and KVM logdirty usage mrhines
2014-02-18 10:32 ` Dr. David Alan Gilbert
2014-02-19 1:42 ` Michael R. Hines
2014-03-11 21:31 ` Juan Quintela [this message]
2014-04-04 3:08 ` Michael R. Hines
2014-02-18 8:50 ` [Qemu-devel] [RFC PATCH v2 03/12] mc: introduce a 'checkpointing' status check into the VCPU states mrhines
2014-03-11 21:36 ` Juan Quintela
2014-04-04 3:11 ` Michael R. Hines
2014-03-11 21:40 ` Eric Blake
2014-04-04 3:12 ` Michael R. Hines
2014-02-18 8:50 ` [Qemu-devel] [RFC PATCH v2 04/12] mc: support custom page loading and copying mrhines
2014-02-18 8:50 ` [Qemu-devel] [RFC PATCH v2 05/12] rdma: accelerated memcpy() support and better external RDMA user interfaces mrhines
2014-02-18 8:50 ` [Qemu-devel] [RFC PATCH v2 06/12] mc: introduce state machine changes for MC mrhines
2014-02-19 1:00 ` Li Guang
2014-02-19 2:14 ` Michael R. Hines
2014-02-20 5:03 ` Michael R. Hines
2014-02-21 8:13 ` Michael R. Hines
2014-02-24 6:48 ` Li Guang
2014-02-26 2:52 ` Li Guang
2014-03-11 21:57 ` Juan Quintela
2014-04-04 3:50 ` Michael R. Hines
2014-02-18 8:50 ` [Qemu-devel] [RFC PATCH v2 07/12] mc: introduce additional QMP statistics for micro-checkpointing mrhines
2014-03-11 21:45 ` Eric Blake
2014-04-04 3:15 ` Michael R. Hines
2014-04-04 4:22 ` Eric Blake
2014-03-11 21:59 ` Juan Quintela
2014-04-04 3:55 ` Michael R. Hines
2014-02-18 8:50 ` [Qemu-devel] [RFC PATCH v2 08/12] mc: core logic mrhines
2014-02-19 1:07 ` Li Guang
2014-02-19 2:16 ` Michael R. Hines
2014-02-19 2:53 ` Li Guang
2014-02-19 4:27 ` Michael R. Hines
2014-02-18 8:50 ` [Qemu-devel] [RFC PATCH v2 09/12] mc: configure and makefile support mrhines
2014-02-18 8:50 ` [Qemu-devel] [RFC PATCH v2 10/12] mc: expose tunable parameter for checkpointing frequency mrhines
2014-03-11 21:49 ` Eric Blake
2014-03-11 22:15 ` Juan Quintela
2014-03-11 22:49 ` Eric Blake
2014-04-04 5:29 ` Michael R. Hines
2014-04-04 14:56 ` Eric Blake
2014-04-11 6:10 ` Michael R. Hines
2014-04-04 16:28 ` Dr. David Alan Gilbert
2014-04-04 16:35 ` Eric Blake
2014-04-04 3:29 ` Michael R. Hines
2014-02-18 8:50 ` [Qemu-devel] [RFC PATCH v2 11/12] mc: introduce new capabilities to control micro-checkpointing mrhines
2014-03-11 21:57 ` Eric Blake
2014-04-04 3:38 ` Michael R. Hines
2014-04-04 4:25 ` Eric Blake
2014-03-11 22:02 ` Juan Quintela
2014-03-11 22:07 ` Eric Blake
2014-04-04 3:57 ` Michael R. Hines
2014-04-04 3:56 ` Michael R. Hines
2014-02-18 8:50 ` [Qemu-devel] [RFC PATCH v2 12/12] mc: activate and use MC if requested mrhines
2014-02-18 9:28 ` [Qemu-devel] [RFC PATCH v2 00/12] mc: fault tolerante through micro-checkpointing Li Guang
2014-02-19 1:29 ` Michael R. Hines
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=87a9cw1kyo.fsf@elfo.mitica \
--to=quintela@redhat.com \
--cc=BIRAN@il.ibm.com \
--cc=EREZH@il.ibm.com \
--cc=GILR@il.ibm.com \
--cc=SADEKJ@il.ibm.com \
--cc=abali@us.ibm.com \
--cc=dbulkow@gmail.com \
--cc=gokul@us.ibm.com \
--cc=hinesmr@cn.ibm.com \
--cc=isaku.yamahata@gmail.com \
--cc=junqing.wang@cs2c.com.cn \
--cc=lig.fnst@cn.fujitsu.com \
--cc=mrhines@linux.vnet.ibm.com \
--cc=mrhines@us.ibm.com \
--cc=onom@us.ibm.com \
--cc=owasserm@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).