Bug 916968

Summary: migration with page compression (xbzrle) on sometimes can not finish (remaining ram: 4 kbytes)
Product: Red Hat Enterprise Linux 7 Reporter: Shaolong Hu <shu>
Component: qemu-kvmAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, juzhang, michen, owasserm, quintela, qzhang, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-01 10:32:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Shaolong Hu 2013-03-01 10:25:24 UTC
Description of problem:
--------------------------
Migration with page compression (xbzrle) on sometimes can not finish (remaining ram: 4 kbytes).


Version-Release number of selected component (if applicable):
--------------------------------------------------------------
qemu-kvm-1.3.0-5.el7


How reproducible:
------------------
1/1

Steps to Reproduce:
---------------------
1.on both src host and des host
(qemu) migrate_set_cache_size 1G
(qemu) migrate_set_capability xbzrle on

2.in guest, add stress with code:

#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
int main()
{
     void wakeup();
     signal(SIGALRM,wakeup);
     alarm(300);
     char *buf = (char *) calloc(40960, 4096);
     while (1) {
        int i;
        for (i = 0; i < 40960 * 4; i++) {
            buf[i * 4096 / 4]++;
        }
        printf(".");
     }
}
void wakeup()
{
    exit(0);
}

3.after step 2, start migration immediately and set speed limit to 10M:
(qemu) migrate -d tcp:0:5555
(qemu) migrate_set_speed 10M

4.migration never ends, get stuck at "remaining ram: 4 kbytes":

(qemu) info migrate
capabilities: xbzrle: on 
Migration status: active
total time: 341779 milliseconds
expected downtime: 638 milliseconds
transferred ram: 1399902 kbytes
remaining ram: 4 kbytes
total ram: 2105728 kbytes
duplicate: 542060 pages
normal: 214521 pages
normal bytes: 858084 kbytes
dirty pages rate: 102946 pages
cache size: 1073741824 bytes
xbzrle transferred: 541289 kbytes
xbzrle pages: 30596884 pages
xbzrle cache miss: 214497
xbzrle overflow : 24

5.purpose to run the special stress in step 2 and set migration speed to 10M is: to create approximate a quota of dirty page with the code (run 300s then exit), due to dirty page generates quickly enough and migration speed limit, before the code exits, migration won't converge and after codes exits migration converges immediately for there is no more workload, i planed to compare the performance of xbzrle=on/off with this method, however run into this problem, i think with common stress the issue can also be reproduced. 

6.if turn off xbzrle, won't hit the problem.

Comment 1 Shaolong Hu 2013-03-01 10:32:01 UTC

*** This bug has been marked as a duplicate of bug 893350 ***