qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Xiao Guangrong <guangrong.xiao@gmail.com>
Cc: pbonzini@redhat.com, mst@redhat.com, mtosatti@redhat.com,
	qemu-devel@nongnu.org, kvm@vger.kernel.org, dgilbert@redhat.com,
	jiang.biao2@zte.com.cn, wei.w.wang@intel.com,
	Xiao Guangrong <xiaoguangrong@tencent.com>
Subject: Re: [Qemu-devel] [PATCH v2 04/10] migration: detect compression and decompression errors
Date: Mon, 2 Apr 2018 12:26:33 +0800	[thread overview]
Message-ID: <20180402042633.GA26441@xz-mi> (raw)
In-Reply-To: <e92d75bc-8f53-039b-f4ac-04eb94e54bd1@gmail.com>

On Fri, Mar 30, 2018 at 11:11:27AM +0800, Xiao Guangrong wrote:
> 
> 
> On 03/29/2018 12:25 PM, Peter Xu wrote:
> > On Thu, Mar 29, 2018 at 11:51:03AM +0800, Xiao Guangrong wrote:
> > > 
> > > 
> > > On 03/28/2018 05:59 PM, Peter Xu wrote:
> > > > On Tue, Mar 27, 2018 at 05:10:37PM +0800, guangrong.xiao@gmail.com wrote:
> > > > 
> > > > [...]
> > > > 
> > > > > -static int compress_threads_load_setup(void)
> > > > > +static int compress_threads_load_setup(QEMUFile *f)
> > > > >    {
> > > > >        int i, thread_count;
> > > > > @@ -2665,6 +2685,7 @@ static int compress_threads_load_setup(void)
> > > > >            }
> > > > >            decomp_param[i].stream.opaque = &decomp_param[i];
> > > > > +        decomp_param[i].file = f;
> > > > 
> > > > On the source side the error will be set via:
> > > > 
> > > >           qemu_file_set_error(migrate_get_current()->to_dst_file, blen);
> > > > 
> > > > Maybe we can do similar things using migrate_incoming_get_current() to
> > > > avoid caching the QEMUFile multiple times?
> > > > 
> > > 
> > > I have considered it, however, it can not work as the @file used by ram
> > > loader is not the file got from migrate_incoming_get_current() under some
> > > cases.
> > > 
> > > For example, in colo_process_incoming_thread(), the file passed to
> > > qemu_loadvm_state() is a internal buffer and it is not easy to switch it
> > > to incoming file.
> > 
> > I see. How about cache it in a global variable?  We have these
> > already:
> > 
> >      thread_count = migrate_decompress_threads();
> >      decompress_threads = g_new0(QemuThread, thread_count);
> >      decomp_param = g_new0(DecompressParam, thread_count);
> >      ...
> > 
> > IMHO we can add a new one too, at least we don't cache it multiple
> > times (after all decomp_param[i]s are global variables too).
> > 
> 
> Nice, that's good to me. Will add your Reviewed-by on this patch
> as well if you do not mind. :)

Yes, please. :)

Thanks,

-- 
Peter Xu

  reply	other threads:[~2018-04-02  3:32 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-27  9:10 [Qemu-devel] [PATCH v2 00/10] migration: improve and cleanup compression guangrong.xiao
2018-03-27  9:10 ` [Qemu-devel] [PATCH v2 01/10] migration: stop compressing page in migration thread guangrong.xiao
2018-03-27  9:10 ` [Qemu-devel] [PATCH v2 02/10] migration: stop compression to allocate and free memory frequently guangrong.xiao
2018-03-28  9:25   ` Peter Xu
2018-03-29  3:41     ` Xiao Guangrong
2018-03-27  9:10 ` [Qemu-devel] [PATCH v2 03/10] migration: stop decompression " guangrong.xiao
2018-03-28  9:42   ` Peter Xu
2018-03-29  3:43     ` Xiao Guangrong
2018-03-29  4:14       ` Peter Xu
2018-03-27  9:10 ` [Qemu-devel] [PATCH v2 04/10] migration: detect compression and decompression errors guangrong.xiao
2018-03-28  9:59   ` Peter Xu
2018-03-29  3:51     ` Xiao Guangrong
2018-03-29  4:25       ` Peter Xu
2018-03-30  3:11         ` Xiao Guangrong
2018-04-02  4:26           ` Peter Xu [this message]
2018-03-27  9:10 ` [Qemu-devel] [PATCH v2 05/10] migration: introduce control_save_page() guangrong.xiao
2018-03-27  9:10 ` [Qemu-devel] [PATCH v2 06/10] migration: move some code ram_save_host_page guangrong.xiao
2018-03-28 10:05   ` Peter Xu
2018-03-27  9:10 ` [Qemu-devel] [PATCH v2 07/10] migration: move calling control_save_page to the common place guangrong.xiao
2018-03-27  9:10 ` [Qemu-devel] [PATCH v2 08/10] migration: move calling save_zero_page " guangrong.xiao
2018-03-27  9:10 ` [Qemu-devel] [PATCH v2 09/10] migration: introduce save_normal_page() guangrong.xiao
2018-03-27  9:10 ` [Qemu-devel] [PATCH v2 10/10] migration: remove ram_save_compressed_page() guangrong.xiao

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=20180402042633.GA26441@xz-mi \
    --to=peterx@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=guangrong.xiao@gmail.com \
    --cc=jiang.biao2@zte.com.cn \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wei.w.wang@intel.com \
    --cc=xiaoguangrong@tencent.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 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).