Re: [PATCH] migration: fix saving normal page even if it's been compressed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Peter Xu (peterx@xxxxxxxxxx) wrote:
> On Sat, Apr 28, 2018 at 04:10:45PM +0800, guangrong.xiao@xxxxxxxxx wrote:
> > From: Xiao Guangrong <xiaoguangrong@xxxxxxxxxxx>
> > 
> > Fix the bug introduced by da3f56cb2e767016 (migration: remove
> > ram_save_compressed_page()), It should be 'return' rather than
> > 'res'
> > 
> > Sorry for this stupid mistake :(
> > 
> > Signed-off-by: Xiao Guangrong <xiaoguangrong@xxxxxxxxxxx>
> 
> Reviewed-by: Peter Xu <peterx@xxxxxxxxxx>
> 
> So is that only a performance degradation without this fix (since
> AFAIU the compressing pages will be sent twice)?  Thanks,

It might be a bit more messy than that; because I think the
'compress_page_with_multi_thread' hands it to a compression thread to
compress and write, but I don't think it waits for it.
So I think you'll end up with this being written at the same time as the
uncompressed data is written - I'm not sure what the other end receives.
(Which makes me realise I don't think I understand how the compression
threads are safe with their writing data out).

Anyway, I think we should get this one in quickly.

Dave

> > ---
> >  migration/ram.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/migration/ram.c b/migration/ram.c
> > index 01cc815410..699546cc43 100644
> > --- a/migration/ram.c
> > +++ b/migration/ram.c
> > @@ -1490,7 +1490,7 @@ static int ram_save_target_page(RAMState *rs, PageSearchStatus *pss,
> >       * CPU resource.
> >       */
> >      if (block == rs->last_sent_block && save_page_use_compression(rs)) {
> > -        res = compress_page_with_multi_thread(rs, block, offset);
> > +        return compress_page_with_multi_thread(rs, block, offset);
> >      }
> >  
> >      return ram_save_page(rs, pss, last_stage);
> > -- 
> > 2.14.3
> > 
> 
> -- 
> Peter Xu
--
Dr. David Alan Gilbert / dgilbert@xxxxxxxxxx / Manchester, UK



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux