From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34971) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R71sJ-00052V-RJ for qemu-devel@nongnu.org; Fri, 23 Sep 2011 05:16:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R71sG-0003q3-H9 for qemu-devel@nongnu.org; Fri, 23 Sep 2011 05:16:51 -0400 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:60777) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R71sG-0003oz-0j for qemu-devel@nongnu.org; Fri, 23 Sep 2011 05:16:48 -0400 Received: from /spool/local by au.ibm.com with XMail ESMTP for from ; Fri, 23 Sep 2011 10:12:44 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p8N9EaaA1515744 for ; Fri, 23 Sep 2011 19:14:38 +1000 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p8N9GYH0018361 for ; Fri, 23 Sep 2011 19:16:34 +1000 Received: from oc4654482034.ibm.com ([9.115.122.78]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p8N9GXtU017354 for ; Fri, 23 Sep 2011 19:16:33 +1000 Message-ID: <4E7C4E48.7030009@vnet.linux.ibm.com> Date: Fri, 23 Sep 2011 17:15:52 +0800 From: Mark Wu MIME-Version: 1.0 References: <1315628610-28222-1-git-send-email-ronniesahlberg@gmail.com> <1315628610-28222-2-git-send-email-ronniesahlberg@gmail.com> In-Reply-To: <1315628610-28222-2-git-send-email-ronniesahlberg@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] This patch adds a new block driver : iSCSI List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org I tested this patch with the following command: x86_64-softmmu/qemu-system-x86_64 --enable-kvm rhel54_1.img -m 1024 -net tap,ifname=tap0,script=no -net nic,model=virtio -sdl -drive file=iscsi://127.0.0.1/iqn.2011-09.com.example:server.target1/ And I found that the whole qemu process would get freezed, not reachable via ping and no response on desktop if there's I/O targeted to the iscsi drive and the iscsi target was forcefully stopped. After checking the backtrace with gdb, I found the I/O thread got stuck on the mutex qemu_global_mutex , which was hold by the vcpu thread. It should be released before re-entering guest. But the vcpu thread was waiting for the completion of iscsi aio request endlessly, and therefore couldn't get chance to release the mutex. So the whole qemu process became unresponsive. But this problem doesn't exist with the combination of virtio and iscsi. Only the I/O process got hung on guest in this case. It's more acceptable. I am not sure how to fix this problem. gdb backtrace: (gdb) info threads 2 Thread 0x7fa0fdd4c700 (LWP 5086) 0x0000003a868de383 in select () from /lib64/libc.so.6 * 1 Thread 0x7fa0fdd4d740 (LWP 5085) 0x0000003a8700dfe4 in __lll_lock_wait () from /lib64/libpthread.so.0 (gdb) bt #0 0x0000003a8700dfe4 in __lll_lock_wait () from /lib64/libpthread.so.0 #1 0x0000003a87009318 in _L_lock_854 () from /lib64/libpthread.so.0 #2 0x0000003a870091e7 in pthread_mutex_lock () from /lib64/libpthread.so.0 #3 0x00000000004c9819 in qemu_mutex_lock (mutex=) at qemu-thread-posix.c:54 #4 0x00000000004a46c6 in main_loop_wait (nonblocking=) at /home/mark/Work/source/qemu/vl.c:1545 #5 0x00000000004a60d6 in main_loop (argc=, argv=, envp=) at /home/mark/Work/source/qemu/vl.c:1579 #6 main (argc=, argv=, envp=) at /home/mark/Work/source/qemu/vl.c:3574 (gdb) t 2 [Switching to thread 2 (Thread 0x7fa0fdd4c700 (LWP 5086))]#0 0x0000003a868de383 in select () from /lib64/libc.so.6 (gdb) bt #0 0x0000003a868de383 in select () from /lib64/libc.so.6 #1 0x00000000004096aa in qemu_aio_wait () at aio.c:193 #2 0x0000000000409815 in qemu_aio_flush () at aio.c:113 #3 0x00000000004761ea in bmdma_cmd_writeb (bm=0x1db2230, val=8) at /home/mark/Work/source/qemu/hw/ide/pci.c:311 #4 0x0000000000555900 in access_with_adjusted_size (addr=0, value=0x7fa0fdd4bdb8, size=1, access_size_min=, access_size_max=, access= 0x555820 , opaque=0x1db2370) at /home/mark/Work/source/qemu/memory.c:284 #5 0x0000000000555ae1 in memory_region_iorange_write (iorange=, offset=, width=, data=8) at /home/mark/Work/source/qemu/memory.c:425 #6 0x000000000054eda1 in kvm_handle_io (env=0x192e080) at /home/mark/Work/source/qemu/kvm-all.c:834 #7 kvm_cpu_exec (env=0x192e080) at /home/mark/Work/source/qemu/kvm-all.c:976 #8 0x000000000052cc1a in qemu_kvm_cpu_thread_fn (arg=0x192e080) at /home/mark/Work/source/qemu/cpus.c:656 #9 0x0000003a870077e1 in start_thread () from /lib64/libpthread.so.0 #10 0x0000003a868e577d in clone () from /lib64/libc.so.6