From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0VxY-0004mr-PP for qemu-devel@nongnu.org; Tue, 18 Apr 2017 12:26:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0VxX-00016t-Sl for qemu-devel@nongnu.org; Tue, 18 Apr 2017 12:26:32 -0400 Received: from mail-wr0-x22b.google.com ([2a00:1450:400c:c0c::22b]:36285) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d0VxX-00016M-Lb for qemu-devel@nongnu.org; Tue, 18 Apr 2017 12:26:31 -0400 Received: by mail-wr0-x22b.google.com with SMTP id c55so106294266wrc.3 for ; Tue, 18 Apr 2017 09:26:31 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Peter Maydell Date: Tue, 18 Apr 2017 17:26:10 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] Hight Processor time of Socket communciation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jiahuan Zhang Cc: QEMU Developers On 18 April 2017 at 17:19, Jiahuan Zhang wrote: > Dear QEMU developers, > I am measuring the processor time for guest-host communication via socket. > The guest app is to write a 5M image to a serial device. > The serial deivce is redirected to the socket in the command line. > The host app is to receive the data via socket until the peer closes the > connection. > Please find in the attachment the Processor time graph generated by Windows > Performance Monitor. > > The graph shows the processor time is almost 100% while communicating. > Surprising me! My expectation is 1%. > > I wonder if this is the right performance for QEMU socket communciation? Or > this high processor time is caused by the serial device? If so, any > optimization I can do? The serial device on the vexpress-a9 model is a PL011, which is a fairly simple UART which all data must be written to byte-at-a-time. This is never going to be fast, because we have to execute a lot of guest code to send the data through this byte-at-a-time bottleneck, and since you're running a purely emulated QEMU, executing guest code means doing a lot of CPU operations. You will likely get better throughput if you use the 'virt' board where you can use the virtio-serial device which can send data more efficiently. thanks -- PMM