From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59979) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R2k9Y-0002R2-W5 for qemu-devel@nongnu.org; Sun, 11 Sep 2011 09:32:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R2k9Y-00057v-1S for qemu-devel@nongnu.org; Sun, 11 Sep 2011 09:32:56 -0400 Received: from verein.lst.de ([213.95.11.211]:59976 helo=newverein.lst.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R2k9X-00057j-S2 for qemu-devel@nongnu.org; Sun, 11 Sep 2011 09:32:56 -0400 Date: Sun, 11 Sep 2011 15:32:54 +0200 From: Christoph Hellwig Message-ID: <20110911133254.GA4055@lst.de> References: <20110909094436.GB23929@f15.cn.ibm.com> <20110909103801.GA26148@stefanha-thinkpad.localdomain> <4E6A1CD7.70300@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E6A1CD7.70300@redhat.com> Subject: Re: [Qemu-devel] Why qemu write/rw speed is so low? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: aliguro@us.ibm.com, Stefan Hajnoczi , Stefan Hajnoczi , qemu-devel@nongnu.org, ryanh@us.ibm.com, Zhi Yong Wu , Zhi Yong Wu On Fri, Sep 09, 2011 at 04:04:07PM +0200, Kevin Wolf wrote: > > need to read in the existing 4 KB, modify the 512 bytes in place, and > > write out the 4 KB block again. This is read-modify-write. In this > > worst-case scenario a 512 byte write turns into a 4 KB read followed > > by a 4 KB write. > > But that should only happen with a 4k sector size, otherwise there's no > reason for RMW. The might not be a need for RMW, but if you're doing 512 byte writes to a sparse file on 4k filesystem that filesystem will have to serialize the I/O to prevent races from happening during block allocation.