Live vm migration broken in latest xen-unstable
Folks,
I am experiencing that live migration is not working in latest xen-unstable. I get the following message during migration
[root@pc5 ksanjay]# xm migrate --live 1 199.77.138.23
Error: /usr/lib/xen/bin/xc_save 18 1 0 0 1 failed [root@pc5 ksanjay]#
I traced the problem to a function in xen named set_sh_allocation() in file xen/arch/x86/mm/shadow/common.c
tools/libxc/xc_linux_save.c:xc_linux_save() is called from the python script which makes the following hypercall
if (live) {
if (xc_shadow_control(xc_handle, dom,
XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY,
NULL, 0, NULL, 0, NULL) < 0) {
ERR("Couldn't enable shadow mode");
goto out;
}
last_iter = 0; } else {
-----------
this particular hypercall leads to the call of set_sh_allocation which fails in the following code
if ( d->arch.shadow.total_pages < pages )
{
/* Need to allocate more memory from domheap */
pg = alloc_domheap_pages(NULL, SHADOW_MAX_ORDER, 0);
if ( pg == NULL )
{
SHADOW_PRINTK("failed to allocate shadow pages.\n");
return -ENOMEM;
}alloc_domheap_pages fails and returns NULL. however I think I have enough memory available so this function should not fail.
Is there anybody else experiencing the same problem? Could someone please tell me how to fix it?
Below is the xm info for my machine.
Thanks for your help,
Sanjay
[root@pc5 ~]# xm info
host : pc5
release : 2.6.16.13-xen0
version : #3 Fri Sep 1 17:13:13 EDT 2006
machine : i686nr_cpus : 4nr_nodes : 1sockets_per_node : 2cores_per_socket : 1threads_per_core : 2cpu_mhz : 2791hw_caps : bfebfbff:00000000:00000000:00000080:00004400total_memory : 511free_memory : 1xen_major : 3xen_minor : 0xen_extra : -unstablexen_caps : xen-3.0-x86_32xen_pagesize : 4096platform_params : virt_start=0xfc000000xen_changeset : Mon Aug 28 08:08:41 2006 +0100 11267:68a1b61ecd28cc_compiler : gcc version 4.0.2 20051125 (Red Hat 4.0.2-8)cc_compile_by : rootcc_compile_domain : netlab.cc.gatech.educc_compile_date : Fri Sep 1 17:12:28 EDT 2006xend_config_format : 2
[root@pc5 ~]#
Signature · 3 lines
---------------------- PhD Student, Georgia Tech http://www.cc.gatech.edu/~ksanjay/
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 38 lines · sanjay kushwaha
Folks,
I am experiencing that live migration is not working in latest xen-unstable. I get the following message during migration[root@pc5 ksanjay]# xm migrate --live 1 [1]199.77.138.23
Error:/usr/lib/xen/bin/xc_save18 1 0 0 1 failed [root@pc5 ksanjay]#I traced the problem to a function in xen named
set_sh_allocation()in filexen/arch/x86/mm/shadow/common.ctools/libxc/xc_linux_save.c:xc_linux_save() is called from the python script which makes the following hypercall
if (live) { if (xc_shadow_control(xc_handle, dom, XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY, NULL, 0, NULL, 0, NULL) < 0) { ERR("Couldn't enable shadow mode"); goto out; } last_iter = 0; } else {-----------
this particular hypercall leads to the call of
set_sh_allocationwhich fails in the following codeif ( d-> arch.shadow.total_pages < pages ) { /* Need to allocate more memory from domheap */ pg = alloc_domheap_pages(NULL, SHADOW_MAX_ORDER, 0); if ( pg == NULL ) { SHADOW_PRINTK("failed to allocate shadow pages.\n"); return -ENOMEM; }
Quoted 5 lines
alloc_domheap_pagesfails and returns NULL. however I think I have enough memory available so this function should not fail.Is there anybody else experiencing the same problem? Could someone please tell me how to fix it?
I've put some changes into xen-unstable today which might help. The last fix is on its way through testing now. Look out for xen-unstable changeset 11422, and try that, see how you get on.
Cheers,
Ewan.
Hi Ewan,
I did a "hg pull -u" on my tree which also got the changeset 11422. but I am still facing the same problem. btw this changeset seems to be specific to hvm domain while I am facing this problem with paravirtualized domain.
Thanks,
Sanjay
Quoted 58 lines · Ewan Mellor
Quoted 38 lines · sanjay kushwaha
Folks,
I am experiencing that live migration is not working in latest xen-unstable. I get the following message during migration[root@pc5 ksanjay]# xm migrate --live 1 [1]199.77.138.23
Error:/usr/lib/xen/bin/xc_save18 1 0 0 1 failed [root@pc5 ksanjay]#I traced the problem to a function in xen named
set_sh_allocation()in filexen/arch/x86/mm/shadow/common.ctools/libxc/xc_linux_save.c:xc_linux_save() is called from the python script which makes the following hypercall
if (live) { if (xc_shadow_control(xc_handle, dom, XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY, NULL, 0, NULL, 0, NULL) < 0) { ERR("Couldn't enable shadow mode"); goto out; } last_iter = 0; } else {-----------
this particular hypercall leads to the call of
set_sh_allocationwhich fails in the following codeif ( d-> arch.shadow.total_pages < pages ) { /* Need to allocate more memory from domheap */ pg = alloc_domheap_pages(NULL, SHADOW_MAX_ORDER, 0); if ( pg == NULL ) { SHADOW_PRINTK("failed to allocate shadow pages.\n"); return -ENOMEM; }Quoted 1 line
alloc_domheap_pagesfails and returns NULL. however I think I haveenough
Quoted 3 lines
memory available so this function should not fail.
Is there anybody else experiencing the same problem? Could someone
please
Quoted 1 line
tell me how to fix it?
I've put some changes into xen-unstable today which might help. The last fix
is on its way through testing now. Look out for xen-unstable changeset 11422, and try that, see how you get on.Cheers,
Ewan.
Signature · 3 lines
---------------------- PhD Student, Georgia Tech http://www.cc.gatech.edu/~ksanjay/ <http://www.cc.gatech.edu/%7Eksanjay/>
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 7 lines · sanjay kushwaha
Hi Ewan,
I did a "hg pull -u" on my tree which also got the changeset 11422. but I am still facing the same problem. btw this changeset seems to be specific to hvm domain while I am facing this problem with paravirtualized domain.Thanks,
Sanjay
I've tested live migration with paravirt domain for changeset 11429, but didn't have such a problem.
Did you also rebuild xen and dom0 kernel after you updated the repository? If not, I would recommend to do so.
Yoshi Tamura
Quoted 70 lines · Ewan Mellor
Quoted 49 lines · sanjay kushwaha
Quoted 39 lines
Folks,
I am experiencing that live migration is not working in latest xen-unstable. I get the following message during migration[root@pc5 ksanjay]# xm migrate --live 1 [1]199.77.138.23
Error:/usr/lib/xen/bin/xc_save18 1 0 0 1 failed [root@pc5 ksanjay]#I traced the problem to a function in xen named
set_sh_allocation()in filexen/arch/x86/mm/shadow/common.ctools/libxc/xc_linux_save.c:xc_linux_save() is called from the python script which makes the following hypercall
if (live) { if (xc_shadow_control(xc_handle, dom, XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY, NULL, 0, NULL, 0, NULL) < 0) { ERR("Couldn't enable shadow mode"); goto out; } last_iter = 0; } else {-----------
this particular hypercall leads to the call of
set_sh_allocationwhich fails in the following codeif ( d-> arch.shadow.total_pages < pages ) { /* Need to allocate more memory from domheap */ pg = alloc_domheap_pages(NULL, SHADOW_MAX_ORDER, 0); if ( pg == NULL ) { SHADOW_PRINTK("failed to allocate shadow pages.\n"); return -ENOMEM; }Quoted 1 line
alloc_domheap_pagesfails and returns NULL. however I think I haveenough
Quoted 3 lines
memory available so this function should not fail.
Is there anybody else experiencing the same problem? Could someone
please
Quoted 1 line
tell me how to fix it?
Quoted 9 lines
I've put some changes into xen-unstable today which might help. The last fix
is on its way through testing now. Look out for xen-unstable changeset 11422, and try that, see how you get on.Cheers,
Ewan.
------------------------------------------------------------------------
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Signature · 10 lines
TAMURA, Yoshiaki NTT Cyber Space Labs OSS Computing Project Kernel Group E-mail: [email protected] TEL: (046)-859-2771 FAX: (046)-855-1152 Address: 1-1 Hikarinooka, Yokosuka Kanagawa 239-0847 JAPAN
Hi Sanjay,
Does the attached patch fix this problem for you? It tries to make sure there is enough spare memory to enable shadow pagetables on the domain before starting the migration.
Cheers,
Tim
Quoted 63 lines · sanjay kushwaha
Hi Ewan,
I did a "hg pull -u" on my tree which also got the changeset 11422. but I am still facing the same problem. btw this changeset seems to be specific to hvm domain while I am facing this problem with paravirtualized domain.Thanks,
SanjayQuoted 54 lines · Ewan Mellor
Quoted 38 lines · sanjay kushwaha
Folks,
I am experiencing that live migration is not working in latest xen-unstable. I get the following message during migration[root@pc5 ksanjay]# xm migrate --live 1 [1]199.77.138.23
Error:/usr/lib/xen/bin/xc_save18 1 0 0 1 failed [root@pc5 ksanjay]#I traced the problem to a function in xen named
set_sh_allocation()in filexen/arch/x86/mm/shadow/common.ctools/libxc/xc_linux_save.c:xc_linux_save() is called from the python script which makes the following hypercall
if (live) { if (xc_shadow_control(xc_handle, dom, XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY, NULL, 0, NULL, 0, NULL) < 0) { ERR("Couldn't enable shadow mode"); goto out; } last_iter = 0; } else {-----------
this particular hypercall leads to the call of
set_sh_allocationwhich fails in the following codeif ( d-> arch.shadow.total_pages < pages ) { /* Need to allocate more memory from domheap */ pg = alloc_domheap_pages(NULL, SHADOW_MAX_ORDER, 0); if ( pg == NULL ) { SHADOW_PRINTK("failed to allocate shadow pages.\n"); return -ENOMEM; }Quoted 1 line
alloc_domheap_pagesfails and returns NULL. however I think I haveenough
Quoted 3 lines
memory available so this function should not fail.
Is there anybody else experiencing the same problem? Could someone
please
Quoted 1 line
tell me how to fix it?
I've put some changes into xen-unstable today which might help. The last fix
is on its way through testing now. Look out for xen-unstable changeset 11422, and try that, see how you get on.
Quoted 16 lines
Quoted 4 lines
Cheers,
Ewan.
Signature · 8 lines
---------------------- PhD Student, Georgia Tech http://www.cc.gatech.edu/~ksanjay/ <http://www.cc.gatech.edu/%7Eksanjay/> _______________________________________________ Xen-devel mailing list [email protected] http://lists.xensource.com/xen-devel
tools/python/xen/xend/XendDomain.py +4 -0
@@ -420,6 +420,10 @@ class XendDomain: """ The following call may raise a XendError exception """ dominfo.testMigrateDevices(True, dst) + if live: + """ Make sure there's memory free for enabling shadow mode """ + dominfo.checkLiveMigrateMemory() + if port == 0: port = xroot.get_xend_relocation_port() try:
tools/python/xen/xend/XendDomainInfo.py +14 -0
@@ -49,6 +49,7 @@ from xen.xend.xenstore.xsutil import Get from xen.xend.xenstore.xsutil import GetDomainPath, IntroduceDomain from xen.xend.xenstore.xswatch import xswatch +from xen.xend import arch """Shutdown code for poweroff.""" DOMAIN_POWEROFF = 0
@@ -1502,6 +1503,19 @@ class XendDomainInfo: self.image.createDeviceModel() ## public: + + def checkLiveMigrateMemory(self): + """ Make sure there's enough memory to migrate this domain """ + overhead_kb = 0 + if arch.type == "x86": + # 1MB per vcpu plus 4Kib/Mib of RAM. This is higher than + # the minimum that Xen would allocate if no value were given. + overhead_kb = self.info['vcpus'] * 1024 + self.info['maxmem'] * 4 + overhead_kb = ((overhead_kb + 1023) / 1024) * 1024 + # The domain might already have some shadow memory + overhead_kb -= xc.shadow_mem_control(self.domid) * 1024 + if overhead_kb > 0: + balloon.free(overhead_kb) def testMigrateDevices(self, network, dst): """ Notify all device about intention of migration
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Hi Tim,
Yes. This patch solved my problem. now live VM migration happens but I am experiencing another problem. when I reattach to the migrated VM console on the destination machine, I see the following traceback in the dmesg of the guest VM.
------------[ cut here ]------------ kernel BUG at drivers/xen/netfront/netfront.c:717! invalid opcode: 0000 [#1] SMP Modules linked in: CPU: 0 EIP: 0061:[<c02598e0>] Not tainted VLI EFLAGS: 00010082 (2.6.16.13-xenU #15)
EIP is at network_alloc_rx_buffers+0x470/0x4b0
eax: c056fc80 ebx: ccbc0d80 ecx: d1001040 edx: c05d0000
esi: c05d02a0 edi: c05d034c ebp: c0551f14 esp: c0551eac
ds: 007b es: 007b ss: 0069
Process xenwatch (pid: 8, threadinfo=c0550000 task=c057a540)
Stack: <0>00000208 00000000 0000cbc1 00000000 c05d034c c05d31b8
c05d0000 00000000
00000337 00000337 0000002f 00000208 ccbc1000 000000d1 cdd25838 00000100
000000d1 00000011 c05d0000 00000001 c02f8013 c05d0000 00000001 c05d02a0
Call Trace:
[<c01058ed>] show_stack_log_lvl+0xcd/0x120
[<c0105aeb>] show_registers+0x1ab/0x240
[<c0105e11>] die+0x111/0x240
[<c0106178>] do_trap+0x98/0xe0
[<c0106491>] do_invalid_op+0xa1/0xb0
[<c01052c7>] error_code+0x2b/0x30
[<c025a554>] backend_changed+0x1a4/0x250
[<c025517e>] otherend_changed+0x7e/0x90
[<c0253361>] xenwatch_handle_callback+0x21/0x60
[<c025345d>] xenwatch_thread+0xbd/0x160
[<c0132b0c>] kthread+0xec/0xf0
[<c0102c45>] kernel_thread_helper+0x5/0x10
Code: 82 04 15 00 00 8d 9e f8 14 00 00 e8 db 78 ea ff 8b 5d d8 39 9afc 14 00 00 0f 84 16 fe ff ff e9 51 ff ff ff 8d b4 26 00 00 00 00 <0f> 0b cd 02 2c a0 2f c0 e9 cd fc ff ff 0f 0b d1 02 2c a0 2f c0
[root@localhost ~]#
Does anyone know if this is a known problem?
Thanks for your help.
Sanjay
Quoted 94 lines · Tim Deegan
Hi Sanjay,
Does the attached patch fix this problem for you? It tries to make sure there is enough spare memory to enable shadow pagetables on the domain before starting the migration.
Cheers,
Tim
Quoted 79 lines · sanjay kushwaha
Hi Ewan,
I did a "hg pull -u" on my tree which also got the changeset 11422. but I am still facing the same problem. btw this changeset seems to be specific to hvm domain while I am facing this problem with paravirtualized domain.Thanks,
SanjayQuoted 49 lines · Ewan Mellor
Quoted 38 lines · sanjay kushwaha
Folks,
I am experiencing that live migration is not working in latest xen-unstable. I get the following message during migration[root@pc5 ksanjay]# xm migrate --live 1 [1]199.77.138.23
Error:/usr/lib/xen/bin/xc_save18 1 0 0 1 failed [root@pc5 ksanjay]#I traced the problem to a function in xen named
set_sh_allocation()in filexen/arch/x86/mm/shadow/common.ctools/libxc/xc_linux_save.c:xc_linux_save() is called from the python script which makes the following hypercall
if (live) { if (xc_shadow_control(xc_handle, dom, XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY, NULL, 0, NULL, 0, NULL) < 0) { ERR("Couldn't enable shadow mode"); goto out; } last_iter = 0; } else {-----------
this particular hypercall leads to the call of
set_sh_allocationwhich fails in the following codeif ( d-> arch.shadow.total_pages < pages ) { /* Need to allocate more memory from domheap */ pg = alloc_domheap_pages(NULL, SHADOW_MAX_ORDER, 0); if ( pg == NULL ) { SHADOW_PRINTK("failed to allocate shadow pages.\n"); return -ENOMEM; }Quoted 1 line
alloc_domheap_pagesfails and returns NULL. however I think I haveenough
Quoted 3 lines
memory available so this function should not fail.
Is there anybody else experiencing the same problem? Could someone
please
Quoted 1 line
tell me how to fix it?
Quoted 9 lines
I've put some changes into xen-unstable today which might help. The last fix
is on its way through testing now. Look out for xen-unstable changeset 11422, and try that, see how you get on.Cheers,
Ewan.
--
----------------------
PhD Student, Georgia Tech
http://www.cc.gatech.edu/~ksanjay/ <http://www.cc.gatech.edu/%7Eksanjay/>_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Signature · 3 lines
---------------------- PhD Student, Georgia Tech http://www.cc.gatech.edu/~ksanjay/
Hi Folks,
I am facing another problem. after the vm migration, the frontend of guest VM doesn't properly attaches with the new backend. I observed that after VM migration, the disk requests sent by blkfront driver are not seen by the blkif_schedule process in the blkback driver. Do you think it is a known problem? has anybody else observed this?
Thanks,
Sanjay
Quoted 162 lines · sanjay kushwaha
Hi Tim,
Yes. This patch solved my problem. now live VM migration happens but I am experiencing another problem. when I reattach to the migrated VM console on the destination machine, I see the following traceback in the dmesg of the guest VM.------------[ cut here ]------------ kernel BUG at drivers/xen/netfront/netfront.c:717! invalid opcode: 0000 [#1] SMP Modules linked in: CPU: 0 EIP: 0061:[<c02598e0>] Not tainted VLI EFLAGS: 00010082 (2.6.16.13-xenU #15)EIP is at
network_alloc_rx_buffers+0x470/0x4b0
eax:c056fc80ebx:ccbc0d80ecx:d1001040edx:c05d0000
esi:c05d02a0edi:c05d034cebp:c0551f14esp:c0551eac
ds: 007b es: 007b ss: 0069
Process xenwatch (pid: 8, threadinfo=c0550000 task=c057a540)Stack: <0>00000208 00000000 0000cbc1 00000000 c05d034c c05d31b8 c05d0000 00000000 00000337 00000337 0000002f 00000208 ccbc1000 000000d1 cdd25838 00000100 000000d1 00000011 c05d0000 00000001 c02f8013 c05d0000 00000001 c05d02a0 Call Trace: [<c01058ed>] show_stack_log_lvl+0xcd/0x120 [<c0105aeb>] show_registers+0x1ab/0x240 [<c0105e11>] die+0x111/0x240 [<c0106178>] do_trap+0x98/0xe0 [<c0106491>] do_invalid_op+0xa1/0xb0 [<c01052c7>] error_code+0x2b/0x30 [<c025a554>] backend_changed+0x1a4/0x250 [<c025517e>] otherend_changed+0x7e/0x90 [<c0253361>] xenwatch_handle_callback+0x21/0x60 [<c025345d>] xenwatch_thread+0xbd/0x160 [<c0132b0c>] kthread+0xec/0xf0 [<c0102c45>] kernel_thread_helper+0x5/0x10 Code: 82 04 15 00 00 8d 9e f8 14 00 00 e8 db 78 ea ff 8b 5d d8 39 9afc 14 00 00 0f 84 16 fe ff ff e9 51 ff ff ff 8d b4 26 00 00 00 00 <0f> 0b cd 02 2c a0 2f c0 e9 cd fc ff ff 0f 0b d1 02 2c a0 2f c0
[root@localhost ~]#
Does anyone know if this is a known problem?
Thanks for your help.
SanjayQuoted 6 lines · Tim Deegan
Hi Sanjay,
Does the attached patch fix this problem for you? It tries to make sure there is enough spare memory to enable shadow pagetables on the domain before starting the migration.
Quoted 7 lines
Cheers,
Tim
Quoted 2 lines · sanjay kushwaha
Hi Ewan,
I did a "hg pull -u" on my tree which also got the changeset 11422.but I am
Quoted 1 line
Quoted 1 line
still facing the same problem. btw this changeset seems to be specific
to
Quoted 13 lines
Quoted 13 lines
hvm domain while I am facing this problem with paravirtualized domain.
Thanks,
SanjayQuoted 7 lines · Ewan Mellor
Quoted 4 lines · sanjay kushwaha
Folks,
I am experiencing that live migration is not working in latest xen-unstable. I get the following message during migrationQuoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
[root@pc5 ksanjay]# xm migrate --live 1 [1]199.77.138.23
Error:/usr/lib/xen/bin/xc_save18 1 0 0 1 failed [root@pc5 ksanjay]#I traced the problem to a function in xen named
set_sh_allocation()in
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
file
xen/arch/x86/mm/shadow/common.ctools/libxc/xc_linux_save.c:xc_linux_save() is called from the
python
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
script which makes the following hypercall
if (live) { if (xc_shadow_control(xc_handle, dom, XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY, NULL, 0, NULL, 0, NULL) < 0) { ERR("Couldn't enable shadow mode"); goto out; } last_iter = 0; } else {-----------
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
this particular hypercall leads to the call of
set_sh_allocationwhich
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
fails in the following code
if ( d-> arch.shadow.total_pages < pages ) { /* Need to allocate more memory from domheap */ pg = alloc_domheap_pages(NULL, SHADOW_MAX_ORDER, 0); if ( pg == NULL ) { SHADOW_PRINTK("failed to allocate shadowpages.\n");
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
return -ENOMEM; }
alloc_domheap_pagesfails and returns NULL. however I think I haveQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
enough
Quoted 3 lines
memory available so this function should not fail.
Is there anybody else experiencing the same problem? Could someone
please
Quoted 1 line
tell me how to fix it?
I've put some changes into xen-unstable today which might help. The
last
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
fix
is on its way through testing now. Look out for xen-unstablechangeset
Quoted 9 lines
Quoted 9 lines
Quoted 6 lines
11422, and try that, see how you get on.
Cheers,
Ewan.
Quoted 4 lines
Quoted 4 lines
--
----------------------
PhD Student, Georgia Tech
http://www.cc.gatech.edu/~ksanjay/ <http://www.cc.gatech.edu/%7Eksanjay/>
Quoted 9 lines
Quoted 5 lines
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel--
----------------------
PhD Student, Georgia Tech
http://www.cc.gatech.edu/~ksanjay/
Signature · 3 lines
---------------------- PhD Student, Georgia Tech http://www.cc.gatech.edu/~ksanjay/
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel