From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [RFC] vhost-blk implementation Date: Tue, 23 Mar 2010 18:53:39 +0200 Message-ID: <4BA8F213.8030807@redhat.com> References: <1269306023.7931.72.camel@badari-desktop> <4BA891E2.9040500@redhat.com> <4BA8D65C.2060605@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Badari Pulavarty Return-path: Received: from mx1.redhat.com ([209.132.183.28]:31712 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751841Ab0CWQxo (ORCPT ); Tue, 23 Mar 2010 12:53:44 -0400 In-Reply-To: <4BA8D65C.2060605@us.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 03/23/2010 04:55 PM, Badari Pulavarty wrote: >> This should be done asynchronously. That is likely the cause of >> write performance degradation. For reads, readahead means that that >> you're async anyway, but writes/syncs are still synchronous. > > I am not sure what you mean by async here. Even if I use > f_op->aio_write() its still synchronous (except for DIO). Since we > are writing to pagecache and not waiting for write() > to complete, this is the best we can do here. It fails with O_DIRECT or O_DSYNC, or if the write cache is full and we need to wait on writeout. Reads that don't hit pagecache will also be synchronous. You could use threads (like qemu) or use the block layer (which is async). > > Do you mean offload write() handling to another thread ? Yeah. Read too. >> >> I also think it should be done at the bio layer. > I am not sure what you meant here. Do you want to do submit_bio() > directly ? Its not going to be that simple. Since the sector# is > offset within the file, one have to do getblocks() on it > to find the real-disk-block#s + we have to do get_user_pages() on > these iovecs before submitting them to bio.. All of this work is done > by vfs_write()/vfs_read() anyway.. I am not > sure what you are suggesting here.. For the case where the file is actually a partition, use submit_bio(). When the file is a file, keep it in qemu, that path is going to be slower anyway. -- error compiling committee.c: too many arguments to function