From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O0Cch-0001b3-HE for qemu-devel@nongnu.org; Fri, 09 Apr 2010 07:43:43 -0400 Received: from [140.186.70.92] (port=56389 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0Ccc-0001YD-Kf for qemu-devel@nongnu.org; Fri, 09 Apr 2010 07:43:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O0CcZ-00082z-B5 for qemu-devel@nongnu.org; Fri, 09 Apr 2010 07:43:38 -0400 Received: from e28smtp03.in.ibm.com ([122.248.162.3]:54341) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0CcY-00082B-MN for qemu-devel@nongnu.org; Fri, 09 Apr 2010 07:43:35 -0400 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by e28smtp03.in.ibm.com (8.14.3/8.13.1) with ESMTP id o39BhSFW032382 for ; Fri, 9 Apr 2010 17:13:28 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o39BhR271986660 for ; Fri, 9 Apr 2010 17:13:28 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o39BhRXG001502 for ; Fri, 9 Apr 2010 17:13:27 +0530 From: "Aneesh Kumar K.V" Date: Fri, 9 Apr 2010 17:13:03 +0530 Message-Id: <1270813404-23004-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH -V4 00/21] virtio-9p: paravirtual file system passthrough List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: ericvh@gmail.com, aliguori@us.ibm.com, aneesh.kumar@linux.vnet.ibm.com This patch series adds VirtFS to QEMU. VirtFS is code named for a 9P filesystem server in QEMU enabling paravirtual filesystem pass-trhough between KVM host and guest. VirtFS is intended to offer an alternative to using NFS/CIFS to share host filesystems on guest and provides better performance. Initial tests showed significantly better performance than NFS and CIFS. Performance numbers are provided towards end of the mail. With the current implementation, all I/O is implemented in the VCPU thread. We've modified the protocol handlers so that we can support dispatch I/O in a thread pool. The actual thread pool implementation will be posted later. This patch set should work with any recent Linux kernel as virtio-9p has been supported for a few kernel releases now. Export dir is specified using the below Qemu option. -fsdev fstype,id=ID,path=path/to/share \ -device virtio-9p-pci,fsdev=ID,mount_tag=tag \ or -virtfs fstype,path=path/to/share,mount_tag=tag Only supported fstype currently is "local". mount_tag is used to identify the mount point in the kernel. This will be available in Linux kernel via /sys/devices/virtio-pci/virtio1/mount_tag file. Changes from V3: 1) Makefiles are modified so that this code is compiled only on Linux. 2) Replaced vasprintf() with qemu_malloc() followed by sprintf(). 3) Formatting changes per QEMU coding standards. 4) Folded bug fixes to original patches c) configure option to enable/disable virtfs Changes from V2: 1) Added new method for specifying export dir. This new method should be more flexible. 2) rebased to qemu master bedd2912c83b1a87a6bfe3f59a892fd65cda7084 Changes from V1: 1) fsstress test suite runs successfully with the patches. That should indicate patches are stable enough to be merged. 2) Added proper error handling to all posix_* calls. 3) Fixed code to follow Qemu coding style. 4) Other bug fixes most of which are folded back into the original patches 5) rebased to qemu master 0aef4261ac0ec9089ade0e3a92f986cb4ba7317e Performance details: # Host * 3650M2 * 16 CPU, 32 GB RAM * 28 JBOD disks (18G each) * DM striped to make a single 400GB disk/filesystem * 400 GB ext3 filesystem exported/serving data in the host * RHEL5.5, QEMU + 9p Server patches # Guest * 1 vCPU, 4GB memory * virtio network access for CIFS, NFS * virtio transport for virtfs mount * 2.6.33-rc8 + v9 fixes (either on mainline or on 9p-devel list) # Tests: * Created 16 20-GB files on the filesystem * Guest mounts filesystem through v9 (virtio), NFS (virtio), CIFS (virtio) * Perform sequential read and sequential write tests on these 16 20-GB files from the guest * Repeat the tests with various threads/processes (dd) counts * Between each test host and guest unmounts and mounts the filesystem to eliminate any caching affects. # read tests (sample): for i in 1 2 3 4 5 6 7 8 do; time dd of=/dev/null if=./file$i bs=2M count=10240 & ; done #of Threads | 1 2 4 8 ---------------------------------------------------- VirtFs(MB/S) | 172 170 168 162 CIFS(MB/S) | 10 12 22 35 NFS(MB/S) | 80 70 62 42 # write tests (sample): for i in 1 2 3 4 5 6 7 8 do; time dd if=/dev/zero of=./file$i bs=2M count=10240 & ; done #of Threads | 1 2 4 8 ------------------------------------------------------- VirtFs(MB/S) | 190 182 150 138 CIFS(MB/S) | 30 38 78 100 NFS(MB/S) | 35 35 38 37