[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 07/10] migration: do not flush_compressed_dat
From: |
Peter Xu |
Subject: |
Re: [Qemu-devel] [PATCH v4 07/10] migration: do not flush_compressed_data at the end of each iteration |
Date: |
Wed, 22 Aug 2018 12:56:21 +0800 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Tue, Aug 21, 2018 at 04:10:26PM +0800, address@hidden wrote:
> From: Xiao Guangrong <address@hidden>
>
> flush_compressed_data() needs to wait all compression threads to
> finish their work, after that all threads are free until the
> migration feeds new request to them, reducing its call can improve
> the throughput and use CPU resource more effectively
>
> We do not need to flush all threads at the end of iteration, the
> data can be kept locally until the memory block is changed or
> memory migration starts over in that case we will meet a dirtied
> page which may still exists in compression threads's ring
You forgot to remove the line in ram_save_iterate(), didn't you? :)
>
> Signed-off-by: Xiao Guangrong <address@hidden>
> ---
> migration/ram.c | 90
> +++++++++++++++++++++++++++++++--------------------------
> 1 file changed, 49 insertions(+), 41 deletions(-)
>
> diff --git a/migration/ram.c b/migration/ram.c
> index 99ecf9b315..1d54285501 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -1602,6 +1602,47 @@ static void migration_update_rates(RAMState *rs,
> int64_t end_time)
> }
> }
>
> +static void
> +update_compress_thread_counts(const CompressParam *param, int bytes_xmit)
> +{
> + if (param->zero_page) {
> + ram_counters.duplicate++;
> + }
> + ram_counters.transferred += bytes_xmit;
> +}
> +
> +static void flush_compressed_data(RAMState *rs)
If no content change in these two functions I would rather just
declare flush_compressed_data() at the beginning of the file which is
oneliner. What do you think?
Regards,
--
Peter Xu
- [Qemu-devel] [PATCH v4 00/10] migration: compression optimization, guangrong . xiao, 2018/08/21
- [Qemu-devel] [PATCH v4 02/10] migration: fix counting normal page for compression, guangrong . xiao, 2018/08/21
- [Qemu-devel] [PATCH v4 03/10] migration: introduce save_zero_page_to_file, guangrong . xiao, 2018/08/21
- [Qemu-devel] [PATCH v4 04/10] migration: drop the return value of do_compress_ram_page, guangrong . xiao, 2018/08/21
- [Qemu-devel] [PATCH v4 05/10] migration: move handle of zero page to the thread, guangrong . xiao, 2018/08/21
- [Qemu-devel] [PATCH v4 01/10] migration: do not wait for free thread, guangrong . xiao, 2018/08/21
- [Qemu-devel] [PATCH v4 06/10] migration: hold the lock only if it is really needed, guangrong . xiao, 2018/08/21
- [Qemu-devel] [PATCH v4 07/10] migration: do not flush_compressed_data at the end of each iteration, guangrong . xiao, 2018/08/21
- Re: [Qemu-devel] [PATCH v4 07/10] migration: do not flush_compressed_data at the end of each iteration,
Peter Xu <=
- [Qemu-devel] [PATCH v4 08/10] migration: fix calculating xbzrle_counters.cache_miss_rate, guangrong . xiao, 2018/08/21
- [Qemu-devel] [PATCH v4 10/10] migration: handle the error condition properly, guangrong . xiao, 2018/08/21
- [Qemu-devel] [PATCH v4 09/10] migration: show the statistics of compression, guangrong . xiao, 2018/08/21