From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9BbJ-0000He-4K for qemu-devel@nongnu.org; Wed, 16 Dec 2015 07:54:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9BbE-0006t8-Dv for qemu-devel@nongnu.org; Wed, 16 Dec 2015 07:54:37 -0500 Received: from e06smtp06.uk.ibm.com ([195.75.94.102]:55103) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9BbE-0006su-0l for qemu-devel@nongnu.org; Wed, 16 Dec 2015 07:54:32 -0500 Received: from localhost by e06smtp06.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 16 Dec 2015 12:54:28 -0000 References: <1448388091-117282-1-git-send-email-pbonzini@redhat.com> <5656D2B9.3010802@de.ibm.com> <5656E158.3090505@redhat.com> <5668907A.80604@redhat.com> From: Christian Borntraeger Message-ID: <56715EEE.6020208@de.ibm.com> Date: Wed, 16 Dec 2015 13:54:06 +0100 MIME-Version: 1.0 In-Reply-To: <5668907A.80604@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 00/40] Sneak peek of virtio and dataplane changes for 2.6 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org, qemu-block@nongnu.org Cc: mlin@kernel.org, famz@redhat.com, ming.lei@canonical.com, stefanha@redhat.com, mst@redhat.com On 12/09/2015 09:35 PM, Paolo Bonzini wrote: > > > On 26/11/2015 11:39, Paolo Bonzini wrote: >> I would really prefer to get rid of vring.c as soon as the infrastructure >> makes it possible---even if it's faster. We know what makes virtio.c >> slower, and it's simpler to fix virtio.c than to convert all the other >> models to vring.c _plus_ make vring.c safe for migration. > > I've now pushed some optimizations of exec.c to the same place (branch > dataplane, git://github.com/bonzini/qemu.git). Basically if the length > of an address_space_read is constant, and the target ends up being RAM, > the compiler can inline address_space_read in the caller and in > particular eliminate the memcpy. Just some quick remarks before I leave into vacation: Performance seems to be better than the initial version. I have some hangs from time to time when shutting down (also with your previous version) (gdb) thread apply all bt Thread 10 (Thread 0x3ff95b7f910 (LWP 9700)): #0 0x000003ff9707cf56 in syscall () from /lib64/libc.so.6 #1 0x0000000010201586 in futex_wait (val=, f=) at /home/cborntra/REPOS/qemu/include/qemu/futex.h:26 #2 qemu_event_wait (ev=ev@entry=0x107f2cb4 ) at /home/cborntra/REPOS/qemu/util/qemu-thread-posix.c:398 #3 0x0000000010214fe2 in call_rcu_thread (opaque=) at /home/cborntra/REPOS/qemu/util/rcu.c:254 #4 0x000003ff971884c6 in start_thread () from /lib64/libpthread.so.0 #5 0x000003ff97082ec2 in thread_start () from /lib64/libc.so.6 Thread 9 (Thread 0x3ff9537f910 (LWP 9701)): #0 0x000003ff9718f5fa in __lll_lock_wait () from /lib64/libpthread.so.0 #1 0x000003ff9718a582 in pthread_mutex_lock () from /lib64/libpthread.so.0 #2 0x0000000010201062 in qemu_mutex_lock (mutex=) at /home/cborntra/REPOS/qemu/util/qemu-thread-posix.c:69 #3 0x0000000010184ffa in aio_context_acquire (ctx=) at /home/cborntra/REPOS/qemu/async.c:361 #4 0x0000000010185322 in thread_pool_completion_bh (opaque=0x3ff90000ca0) at /home/cborntra/REPOS/qemu/thread-pool.c:168 #5 0x0000000010184b0c in aio_bh_call (bh=) at /home/cborntra/REPOS/qemu/async.c:64 #6 aio_bh_poll (ctx=ctx@entry=0x480e00d0) at /home/cborntra/REPOS/qemu/async.c:96 #7 0x0000000010191ec2 in aio_poll (ctx=0x480e00d0, blocking=blocking@entry=true) at /home/cborntra/REPOS/qemu/aio-posix.c:464 #8 0x00000000100c4bfe in iothread_run (opaque=0x480dfc00) at /home/cborntra/REPOS/qemu/iothread.c:42 #9 0x000003ff971884c6 in start_thread () from /lib64/libpthread.so.0 #10 0x000003ff97082ec2 in thread_start () from /lib64/libc.so.6 Thread 8 (Thread 0x3ff94b7f910 (LWP 9702)): #0 0x000003ff970766e6 in ppoll () from /lib64/libc.so.6 #1 0x00000000101908c0 in ppoll (__ss=0x0, __timeout=0x0, __nfds=, __fds=) at /usr/include/bits/poll2.h:77 #2 qemu_poll_ns (fds=, nfds=, timeout=timeout@entry=-1) at /home/cborntra/REPOS/qemu/qemu-timer.c:312 #3 0x0000000010191f44 in aio_poll (ctx=0x480e0890, blocking=blocking@entry=true) at /home/cborntra/REPOS/qemu/aio-posix.c:447 #4 0x00000000100c4bfe in iothread_run (opaque=0x480e05c0) at /home/cborntra/REPOS/qemu/iothread.c:42 #5 0x000003ff971884c6 in start_thread () from /lib64/libpthread.so.0 #6 0x000003ff97082ec2 in thread_start () from /lib64/libc.so.6 Thread 7 (Thread 0x3ff8ffff910 (LWP 9703)): #0 0x000003ff970766e6 in ppoll () from /lib64/libc.so.6 #1 0x00000000101908c0 in ppoll (__ss=0x0, __timeout=0x0, __nfds=, __fds=) at /usr/include/bits/poll2.h:77 #2 qemu_poll_ns (fds=, nfds=, timeout=timeout@entry=-1) at /home/cborntra/REPOS/qemu/qemu-timer.c:312 #3 0x0000000010191f44 in aio_poll (ctx=0x480e1800, blocking=blocking@entry=true) at /home/cborntra/REPOS/qemu/aio-posix.c:447 #4 0x00000000100c4bfe in iothread_run (opaque=0x480e0d60) at /home/cborntra/REPOS/qemu/iothread.c:42 #5 0x000003ff971884c6 in start_thread () from /lib64/libpthread.so.0 #6 0x000003ff97082ec2 in thread_start () from /lib64/libc.so.6 Thread 6 (Thread 0x3ff8f7ff910 (LWP 9704)): #0 0x000003ff970766e6 in ppoll () from /lib64/libc.so.6 #1 0x00000000101908c0 in ppoll (__ss=0x0, __timeout=0x0, __nfds=, __fds=) at /usr/include/bits/poll2.h:77 #2 qemu_poll_ns (fds=, nfds=, timeout=timeout@entry=-1) at /home/cborntra/REPOS/qemu/qemu-timer.c:312 #3 0x0000000010191f44 in aio_poll (ctx=0x480e1f60, blocking=blocking@entry=true) at /home/cborntra/REPOS/qemu/aio-posix.c:447 #4 0x00000000100c4bfe in iothread_run (opaque=0x480e1cb0) at /home/cborntra/REPOS/qemu/iothread.c:42 #5 0x000003ff971884c6 in start_thread () from /lib64/libpthread.so.0 #6 0x000003ff97082ec2 in thread_start () from /lib64/libc.so.6 Thread 5 (Thread 0x3ff8e2f9910 (LWP 9707)): #0 0x000003ff9718f61e in __lll_lock_wait () from /lib64/libpthread.so.0 #1 0x000003ff9719262e in __pthread_mutex_cond_lock () from /lib64/libpthread.so.0 #2 0x000003ff9718c5be in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #3 0x00000000102011da in qemu_cond_wait (cond=, mutex=mutex@entry=0x103c7780 ) at /home/cborntra/REPOS/qemu/util/qemu-thread-posix.c:141 #4 0x0000000010044604 in qemu_kvm_wait_io_event (cpu=) at /home/cborntra/REPOS/qemu/cpus.c:1016 #5 qemu_kvm_cpu_thread_fn (arg=0x484ae660) at /home/cborntra/REPOS/qemu/cpus.c:1055 #6 0x000003ff971884c6 in start_thread () from /lib64/libpthread.so.0 ---Type to continue, or q to quit--- #7 0x000003ff97082ec2 in thread_start () from /lib64/libc.so.6 Thread 4 (Thread 0x3ff8daf9910 (LWP 9708)): #0 0x000003ff9718f61e in __lll_lock_wait () from /lib64/libpthread.so.0 #1 0x000003ff9719262e in __pthread_mutex_cond_lock () from /lib64/libpthread.so.0 #2 0x000003ff9718c5be in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #3 0x00000000102011da in qemu_cond_wait (cond=, mutex=mutex@entry=0x103c7780 ) at /home/cborntra/REPOS/qemu/util/qemu-thread-posix.c:141 #4 0x0000000010044604 in qemu_kvm_wait_io_event (cpu=) at /home/cborntra/REPOS/qemu/cpus.c:1016 #5 qemu_kvm_cpu_thread_fn (arg=0x484c0900) at /home/cborntra/REPOS/qemu/cpus.c:1055 #6 0x000003ff971884c6 in start_thread () from /lib64/libpthread.so.0 #7 0x000003ff97082ec2 in thread_start () from /lib64/libc.so.6 Thread 3 (Thread 0x3ff8d2f9910 (LWP 9709)): #0 0x000003ff9718f61e in __lll_lock_wait () from /lib64/libpthread.so.0 #1 0x000003ff9719262e in __pthread_mutex_cond_lock () from /lib64/libpthread.so.0 #2 0x000003ff9718c5be in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #3 0x00000000102011da in qemu_cond_wait (cond=, mutex=mutex@entry=0x103c7780 ) at /home/cborntra/REPOS/qemu/util/qemu-thread-posix.c:141 #4 0x0000000010044604 in qemu_kvm_wait_io_event (cpu=) at /home/cborntra/REPOS/qemu/cpus.c:1016 #5 qemu_kvm_cpu_thread_fn (arg=0x484d2ba0) at /home/cborntra/REPOS/qemu/cpus.c:1055 #6 0x000003ff971884c6 in start_thread () from /lib64/libpthread.so.0 #7 0x000003ff97082ec2 in thread_start () from /lib64/libc.so.6 Thread 2 (Thread 0x3ff8ca7f910 (LWP 9710)): #0 0x000003ff9718f61e in __lll_lock_wait () from /lib64/libpthread.so.0 #1 0x000003ff9719262e in __pthread_mutex_cond_lock () from /lib64/libpthread.so.0 #2 0x000003ff9718c5be in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #3 0x00000000102011da in qemu_cond_wait (cond=, mutex=mutex@entry=0x103c7780 ) at /home/cborntra/REPOS/qemu/util/qemu-thread-posix.c:141 #4 0x0000000010044604 in qemu_kvm_wait_io_event (cpu=) at /home/cborntra/REPOS/qemu/cpus.c:1016 #5 qemu_kvm_cpu_thread_fn (arg=0x484e4e40) at /home/cborntra/REPOS/qemu/cpus.c:1055 #6 0x000003ff971884c6 in start_thread () from /lib64/libpthread.so.0 #7 0x000003ff97082ec2 in thread_start () from /lib64/libc.so.6 Thread 1 (Thread 0x3ff98bdcbb0 (LWP 9690)): #0 0x000003ff970766e6 in ppoll () from /lib64/libc.so.6 #1 0x00000000101908c0 in ppoll (__ss=0x0, __timeout=0x0, __nfds=, __fds=) at /usr/include/bits/poll2.h:77 #2 qemu_poll_ns (fds=, nfds=, timeout=timeout@entry=-1) at /home/cborntra/REPOS/qemu/qemu-timer.c:312 #3 0x0000000010191f44 in aio_poll (ctx=ctx@entry=0x480e00d0, blocking=blocking@entry=true) at /home/cborntra/REPOS/qemu/aio-posix.c:447 #4 0x00000000101c8ff4 in bdrv_flush (bs=bs@entry=0x480fa160) at /home/cborntra/REPOS/qemu/block/io.c:2426 #5 0x000000001018bba6 in bdrv_close (bs=bs@entry=0x480fa160) at /home/cborntra/REPOS/qemu/block.c:1914 #6 0x000000001018c0f6 in bdrv_close_all () at /home/cborntra/REPOS/qemu/block.c:1974 #7 0x0000000010014102 in main (argc=, argv=, envp=) at /home/cborntra/REPOS/qemu/vl.c:4687 (gdb)