All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zheng Chuan <zhengchuan@huawei.com>
To: David Edmondson <david.edmondson@oracle.com>,
	<quintela@redhat.com>, <eblake@redhat.com>, <dgilbert@redhat.com>,
	<berrange@redhat.com>
Cc: alex.chen@huawei.com, ann.zhuangyanying@huawei.com,
	zhang.zhanghailiang@huawei.com, xiexiangyou@huawei.com,
	qemu-devel@nongnu.org
Subject: Re: [PATCH v6 01/12] migration/dirtyrate: setup up query-dirtyrate framwork
Date: Mon, 31 Aug 2020 19:07:58 +0800	[thread overview]
Message-ID: <110f5a93-6bc4-4079-8e69-31aac0e51ee6@huawei.com> (raw)
In-Reply-To: <m2lfhvci17.fsf@oracle.com>



On 2020/8/31 16:54, David Edmondson wrote:
> On Saturday, 2020-08-29 at 10:52:46 +08, Chuan Zheng wrote:
> 
>> Add get_dirtyrate_thread() functions to setup query-dirtyrate
>> framework.
>>
>> Signed-off-by: Chuan Zheng <zhengchuan@huawei.com>
>> Signed-off-by: YanYing Zhuang <ann.zhuangyanying@huawei.com>
>> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> 
> Modulo the question below...
> 
> Reviewed-by: David Edmondson <david.edmondson@oracle.com>
> 
>> ---
>>  migration/dirtyrate.c | 38 ++++++++++++++++++++++++++++++++++++++
>>  migration/dirtyrate.h | 29 +++++++++++++++++++++++++++++
>>  migration/meson.build |  2 +-
>>  3 files changed, 68 insertions(+), 1 deletion(-)
>>  create mode 100644 migration/dirtyrate.c
>>  create mode 100644 migration/dirtyrate.h
>>
>> diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c
>> new file mode 100644
>> index 0000000..44d673a
>> --- /dev/null
>> +++ b/migration/dirtyrate.c
>> @@ -0,0 +1,38 @@
>> +/*
>> + * Dirtyrate implement code
>> + *
>> + * Copyright (c) 2017-2020 HUAWEI TECHNOLOGIES CO.,LTD.
> 
> Idle query, given that I'm not a lawyer, has this code really been
> around since 2017?
> 
We have evaluated dirty rate by simulating dirtylog as qemu migration does in our first
inside-version since 2017, but it hurts vm performace, and the hash method replaced
the old method recently.
I will consider to write in since 2020, because it is indeed just refactored recently:)

>> + *
>> + * Authors:
>> + *  Chuan Zheng <zhengchuan@huawei.com>
>> + *
>> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
>> + * See the COPYING file in the top-level directory.
>> + */
>> +
>> +#include "qemu/osdep.h"
>> +#include "qapi/error.h"
>> +#include "cpu.h"
>> +#include "qemu/config-file.h"
>> +#include "exec/memory.h"
>> +#include "exec/ramblock.h"
>> +#include "exec/target_page.h"
>> +#include "qemu/rcu_queue.h"
>> +#include "qapi/qapi-commands-migration.h"
>> +#include "migration.h"
>> +#include "dirtyrate.h"
>> +
>> +static void calculate_dirtyrate(struct DirtyRateConfig config)
>> +{
>> +    /* todo */
>> +    return;
>> +}
>> +
>> +void *get_dirtyrate_thread(void *arg)
>> +{
>> +    struct DirtyRateConfig config = *(struct DirtyRateConfig *)arg;
>> +
>> +    calculate_dirtyrate(config);
>> +
>> +    return NULL;
>> +}
>> diff --git a/migration/dirtyrate.h b/migration/dirtyrate.h
>> new file mode 100644
>> index 0000000..5be9714
>> --- /dev/null
>> +++ b/migration/dirtyrate.h
>> @@ -0,0 +1,29 @@
>> +/*
>> + *  Dirtyrate common functions
>> + *
>> + *  Copyright (c) 2020 HUAWEI TECHNOLOGIES CO., LTD.
>> + *
>> + *  Authors:
>> + *  Chuan Zheng <zhengchuan@huawei.com>
>> + *
>> + *  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_MIGRATION_DIRTYRATE_H
>> +#define QEMU_MIGRATION_DIRTYRATE_H
>> +
>> +/*
>> + * Sample 512 pages per GB as default.
>> + * TODO: Make it configurable.
>> + */
>> +#define DIRTYRATE_DEFAULT_SAMPLE_PAGES            512
>> +
>> +struct DirtyRateConfig {
>> +    uint64_t sample_pages_per_gigabytes; /* sample pages per GB */
>> +    int64_t sample_period_seconds; /* time duration between two sampling */
>> +};
>> +
>> +void *get_dirtyrate_thread(void *arg);
>> +#endif
>> +
>> diff --git a/migration/meson.build b/migration/meson.build
>> index ac8ff14..b5b71c8 100644
>> --- a/migration/meson.build
>> +++ b/migration/meson.build
>> @@ -37,4 +37,4 @@ softmmu_ss.add(when: ['CONFIG_RDMA', rdma], if_true: files('rdma.c'))
>>  softmmu_ss.add(when: 'CONFIG_LIVE_BLOCK_MIGRATION', if_true: files('block.c'))
>>  softmmu_ss.add(when: 'CONFIG_ZSTD', if_true: [files('multifd-zstd.c'), zstd])
>>  
>> -specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files('ram.c'))
>> +specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files('dirtyrate.c', 'ram.c'))
>> -- 
>> 1.8.3.1
> 
> dme.
> 



  reply	other threads:[~2020-08-31 11:09 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-29  2:52 [PATCH v6 00/12] *** A Method for evaluating dirty page rate *** Chuan Zheng
2020-08-29  2:52 ` [PATCH v6 01/12] migration/dirtyrate: setup up query-dirtyrate framwork Chuan Zheng
2020-08-31  8:54   ` David Edmondson
2020-08-31 11:07     ` Zheng Chuan [this message]
2020-08-29  2:52 ` [PATCH v6 02/12] migration/dirtyrate: add DirtyRateStatus to denote calculation status Chuan Zheng
2020-08-29  2:52 ` [PATCH v6 03/12] migration/dirtyrate: Add RamblockDirtyInfo to store sampled page info Chuan Zheng
2020-08-31  9:06   ` David Edmondson
2020-08-31  9:07   ` David Edmondson
2020-08-29  2:52 ` [PATCH v6 04/12] migration/dirtyrate: Add dirtyrate statistics series functions Chuan Zheng
2020-08-29  2:52 ` [PATCH v6 05/12] migration/dirtyrate: move RAMBLOCK_FOREACH_MIGRATABLE into ram.h Chuan Zheng
2020-08-31  9:07   ` David Edmondson
2020-08-29  2:52 ` [PATCH v6 06/12] migration/dirtyrate: Record hash results for each sampled page Chuan Zheng
2020-08-31  9:08   ` David Edmondson
2020-08-29  2:52 ` [PATCH v6 07/12] migration/dirtyrate: Compare page hash results for recorded " Chuan Zheng
2020-08-31  9:10   ` David Edmondson
2020-08-31 11:10     ` Zheng Chuan
2020-08-29  2:52 ` [PATCH v6 08/12] migration/dirtyrate: skip sampling ramblock with size below MIN_RAMBLOCK_SIZE Chuan Zheng
2020-08-31  9:12   ` David Edmondson
2020-08-29  2:52 ` [PATCH v6 09/12] migration/dirtyrate: Implement set_sample_page_period() and get_sample_page_period() Chuan Zheng
2020-08-31  9:12   ` David Edmondson
2020-08-29  2:52 ` [PATCH v6 10/12] migration/dirtyrate: Implement calculate_dirtyrate() function Chuan Zheng
2020-08-31  9:13   ` David Edmondson
2020-08-31 11:24     ` Zheng Chuan
2020-08-31 12:01       ` David Edmondson
2020-08-29  2:52 ` [PATCH v6 11/12] migration/dirtyrate: Implement qmp_cal_dirty_rate()/qmp_get_dirty_rate() function Chuan Zheng
2020-08-29  2:52 ` [PATCH v6 12/12] migration/dirtyrate: Add trace_calls to make it easier to debug Chuan Zheng
2020-08-31  9:14   ` David Edmondson
2020-08-31  9:05 ` [PATCH v6 00/12] *** A Method for evaluating dirty page rate *** David Edmondson
2020-08-31  9:55   ` Zheng Chuan
2020-08-31 10:08     ` David Edmondson

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=110f5a93-6bc4-4079-8e69-31aac0e51ee6@huawei.com \
    --to=zhengchuan@huawei.com \
    --cc=alex.chen@huawei.com \
    --cc=ann.zhuangyanying@huawei.com \
    --cc=berrange@redhat.com \
    --cc=david.edmondson@oracle.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=xiexiangyou@huawei.com \
    --cc=zhang.zhanghailiang@huawei.com \
    /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.