From: Ian Jackson Subject: Re: [PATCH v2] xl: track child processes for the benefit of libxl Date: Fri, 18 May 2012 19:27:25 +0100 Message-ID: <20406.38029.741183.334689@mariner.uk.xensource.com> References: <20406.37918.733921.594303@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20406.37918.733921.594303@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org, Ian Campbell , Roger Pau Monne List-Id: xen-devel@lists.xenproject.org Ian Jackson writes ("[PATCH v2] xl: track child processes for the benefit of libxl"): > Each time xl forks, it needs to record the pid, so that its exit > status can be preserved if it happens that libxl's event loop reaped > it. Consequently we also have a new wrapper for waitpid, which in > that case returns the previously-reaped status. I have tested this on top of current tip ("x86/mem_sharing: Allow paging-in pages to be replaced by shared ones") plus my event debugging series and: Loading new save file incoming migration stream (new xl fmt info 0x0/0x0/853) Savefile contains xl domain config xc: Saving memory: iter 0 (last sent 0 skipped 0): 131072/131072 100% xc: Saving memory: iter 1 (last sent 130814 skipped 258): 131072/131072 100% xc: Saving memory: iter 2 (last sent 306 skipped 0): 131072/131072 100% xc: Saving memory: iter 3 (last sent 53 skipped 0): 131072/131072 100% xc: Saving memory: iter 4 (last sent 0 skipped 0): 131072/131072 100% xc: error: Max batch size exceeded (-18). Giving up.: Internal error xc: error: Error when reading batch (90 = Message too long): Internal error libxl: error: libxl_dom.c:430:libxl__domain_restore_common: restoring domain: Resource temporarily unavailable libxl: error: libxl_create.c:596:do_domain_create: cannot (re-)build domain: -3 libxl: error: libxl.c:1043:libxl_domain_destroy: non-existant domain 123 migration target: Domain creation failed (code -3). libxl: error: libxl_utils.c:364:libxl_read_exactly: file/stream truncated reading ready message from migration receiver stream libxl: info: libxl_exec.c:108:libxl_report_child_exitstatus: migration target process [28059] exited with error status 3 Migration failed, resuming at sender. root@bedbug:~/shadow/tools/libxl# I don't think this is my fault. Also after this happens the guest crashes: root@bedbug:~# xl console debian.guest.osstest [ 47.118283] ------------[ cut here ]------------ [ 47.118283] kernel BUG at /tmp/buildd/linux-2.6-2.6.32/debian/build/source_i386_none/drivers/xen/events.c:839! [ 47.118283] invalid opcode: 0000 [#1] SMP [ 47.118283] last sysfs file: /sys/devices/virtual/net/lo/operstate [ 47.118283] Modules linked in: evdev snd_pcm snd_timer snd soundcore snd_page_alloc pcspkr ext3 jbd mbcache xen_netfront xen_blkfront [ 47.118283] [ 47.118283] Pid: 531, comm: kstop/0 Not tainted (2.6.32-5-686-bigmem #1) [ 47.118283] EIP: 0061:[] EFLAGS: 00010082 CPU: 0 [ 47.118283] EIP is at xen_irq_resume+0xd9/0x21f [ 47.118283] EAX: ffffffef EBX: 00000000 ECX: deadbeef EDX: de2d5f40 [ 47.118283] ESI: 00000000 EDI: de2d5fb0 EBP: c14f29fc ESP: de2d5f10 [ 47.118283] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0069 [ 47.118283] Process kstop/0 (pid: 531, ti=de2d4000 task=df968000 task.ti=de2d4000) [ 47.118283] Stack: [ 47.118283] 00000000 00000003 c143b474 c24184f0 00000000 00000000 00000002 00000010 [ 47.118283] <0> c1005744 deadbeef 00000003 de2d5fb0 00000000 00000000 0000f3f3 deadbeef [ 47.118283] <0> 00000003 de2d5fb0 00000000 c1197494 df851f8c c14995ec 00000003 de2d5fb0 [ 47.118283] Call Trace: [ 47.118283] [] ? xen_force_evtchn_callback+0xc/0x10 [ 47.118283] [] ? xen_suspend+0x99/0xb0 [ 47.118283] [] ? stop_cpu+0x6d/0xab [ 47.118283] [] ? worker_thread+0x141/0x1bd [ 47.118283] [] ? stop_cpu+0x0/0xab [ 47.118283] [] ? autoremove_wake_function+0x0/0x2d [ 47.118283] [] ? worker_thread+0x0/0x1bd [ 47.118283] [] ? kthread+0x61/0x66 [ 47.118283] [] ? kthread+0x0/0x66 [ 47.118283] [] ? kernel_thread_helper+0x7/0x10 [ 47.118283] Code: fe 0f b7 45 08 39 d8 74 04 0f 0b eb fe 8b 44 24 10 8d 54 24 30 89 5c 24 30 89 44 24 34 b8 01 00 00 00 e8 f3 fa ff ff 85 c0 74 04 <0f> 0b eb fe 8b 4c 24 38 8d 7c 24 24 89 0c 24 89 34 8d e0 1e 3c [ 47.118283] EIP: [] xen_irq_resume+0xd9/0x21f SS:ESP 0069:de2d5f10 [ 47.118283] ---[ end trace 838e9608136663d9 ]--- [ 47.118283] ------------[ cut here ]------------ [ 47.118283] WARNING: at /tmp/buildd/linux-2.6-2.6.32/debian/build/source_i386_none/kernel/time/timekeeping.c:260 ktime_get+0x1f/0xcb() [ 47.118283] Modules linked in: evdev snd_pcm snd_timer snd soundcore snd_page_alloc pcspkr ext3 jbd mbcache xen_netfront xen_blkfront [ 47.118283] Pid: 0, comm: swapper Tainted: G D 2.6.32-5-686-bigmem #1 [ 47.118283] Call Trace: [ 47.118283] [] ? ktime_get+0x1f/0xcb [ 47.118283] [] ? ktime_get+0x1f/0xcb [ 47.118283] [] ? warn_slowpath_common+0x5e/0x8a [ 47.118283] [] ? warn_slowpath_null+0xa/0xc [ 47.118283] [] ? ktime_get+0x1f/0xcb [ 47.118283] [] ? tick_nohz_stop_sched_tick+0x5d/0x36e [ 47.118283] [] ? hrtimer_start_range_ns+0xf/0x13 [ 47.118283] [] ? tick_nohz_restart_sched_tick+0x128/0x12d [ 47.118283] [] ? cpu_idle+0x67/0xa2 [ 47.118283] [] ? start_kernel+0x318/0x31d [ 47.118283] [] ? xen_start_kernel+0x46a/0x471 [ 47.118283] [] ? udp_init+0x30/0x8c [ 47.118283] ---[ end trace 838e9608136663da ]---