Re: [Qemu-devel] [PATCH] xbzrle: don't check the value in the vm ram repeatedly

2014-03-31 Thread Dr. David Alan Gilbert
* (chenliang0...@icloud.com) wrote: > It is ok, we just need to guarantee that the pages in cache are same to the > page in dest side. > Don??t care about whether they are same to src side. Because the modified > pages during this > time will be sent at next time. It's an interesting, if

Re: [Qemu-devel] [PATCH] xbzrle: don't check the value in the vm ram repeatedly

2014-03-29 Thread Eric Blake
On 03/29/2014 09:12 AM, 陈梁 wrote: >/* word at a time for speed */ >if (!res) { >while (i < slen && > (*(long *)(old_buf + i)) == (*(long *)(new_buf + i))) { >i += sizeof(long); >zrun_len += sizeof(long); >} >

Re: [Qemu-devel] [PATCH] xbzrle: don't check the value in the vm ram repeatedly

2014-03-29 Thread Eric Blake
On 03/29/2014 09:00 AM, 陈梁 wrote: >>> You really need to do the "go over the rest" loop on an 8-byte temporary >>> variable. Ever since your patch made new_buf be a volatile buffer, >>> rather than a static copy, you MUST visit each byte of new_buf exactly once. >>> >> hmm, thanks. get it. Maybe

Re: [Qemu-devel] [PATCH] xbzrle: don't check the value in the vm ram repeatedly

2014-03-29 Thread Eric Blake
On 03/29/2014 08:15 AM, 陈梁 wrote: >> >> Insufficient. Observe what we did at line 52 when looking for the zero-run: >> /* word at a time for speed */ if (!res) { while (i < slen && (*(long *)(old_buf + i)) == (*(long *)(new_buf + i)))

Re: [Qemu-devel] [PATCH] xbzrle: don't check the value in the vm ram repeatedly

2014-03-29 Thread 陈梁
> On 03/29/2014 01:52 AM, arei.gong...@huawei.com wrote: >> From: ChenLiang >> >> xbzrle_encode_buffer checks the value in the ram repeatedly. >> It is risk if runs xbzrle_encode_buffer on changing data. >> And it is not necessary. >> >> Reported-by: Dr. David Alan Gilbert >> Signed-off-by: C

Re: [Qemu-devel] [PATCH] xbzrle: don't check the value in the vm ram repeatedly

2014-03-29 Thread Eric Blake
On 03/29/2014 01:52 AM, arei.gong...@huawei.com wrote: > From: ChenLiang > > xbzrle_encode_buffer checks the value in the ram repeatedly. > It is risk if runs xbzrle_encode_buffer on changing data. > And it is not necessary. > > Reported-by: Dr. David Alan Gilbert > Signed-off-by: ChenLiang >

[Qemu-devel] [PATCH] xbzrle: don't check the value in the vm ram repeatedly

2014-03-29 Thread arei.gonglei
From: ChenLiang xbzrle_encode_buffer checks the value in the ram repeatedly. It is risk if runs xbzrle_encode_buffer on changing data. And it is not necessary. Reported-by: Dr. David Alan Gilbert Signed-off-by: ChenLiang Signed-off-by: Gonglei --- xbzrle.c | 4 1 file changed, 4 inserti