From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L6vDK-0000hz-C6 for qemu-devel@nongnu.org; Sun, 30 Nov 2008 17:56:30 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L6vDI-0000hT-66 for qemu-devel@nongnu.org; Sun, 30 Nov 2008 17:56:29 -0500 Received: from [199.232.76.173] (port=55548 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L6vDI-0000hL-0r for qemu-devel@nongnu.org; Sun, 30 Nov 2008 17:56:28 -0500 Received: from yx-out-1718.google.com ([74.125.44.158]:4662) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L6vDH-0008M8-Di for qemu-devel@nongnu.org; Sun, 30 Nov 2008 17:56:27 -0500 Received: by yx-out-1718.google.com with SMTP id 3so803077yxi.82 for ; Sun, 30 Nov 2008 14:56:27 -0800 (PST) Message-ID: <49331A17.2080707@codemonkey.ws> Date: Sun, 30 Nov 2008 16:56:23 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [5839] qemu-img: open files with cache=writeback References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Aurelien Jarno wrote: > Revision: 5839 > http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5839 > Author: aurel32 > Date: 2008-11-30 19:12:49 +0000 (Sun, 30 Nov 2008) > > Log Message: > ----------- > qemu-img: open files with cache=writeback > > Data integrity is not important in qemu-img, so open the files with > cache=writeback. This fixes the performance regression seen with qemu-img > since revision 5485, and most particularly with the qcow2 format. > > Signed-off-by: Aurelien Jarno > My thinking was to just make qcow2 always default to cache=writeback. I posted an RFC but received no feedback. I guess that means noone disagreed :-) Regards, Anthony Liguori > Revision Links: > -------------- > http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5485 > > Modified Paths: > -------------- > trunk/qemu-img.c > > Modified: trunk/qemu-img.c > =================================================================== > --- trunk/qemu-img.c 2008-11-30 17:54:28 UTC (rev 5838) > +++ trunk/qemu-img.c 2008-11-30 19:12:49 UTC (rev 5839) > @@ -30,6 +30,9 @@ > #include > #endif > > +/* Default to cache=writeback as data integrity is not important for qemu-tcg. */ > +#define BRDV_O_FLAGS BDRV_O_CACHE_WB > + > static void __attribute__((noreturn)) error(const char *fmt, ...) > { > va_list ap; > @@ -186,7 +189,7 @@ > } else { > drv = NULL; > } > - if (bdrv_open2(bs, filename, 0, drv) < 0) { > + if (bdrv_open2(bs, filename, BRDV_O_FLAGS, drv) < 0) { > error("Could not open '%s'", filename); > } > if (bdrv_is_encrypted(bs)) { > @@ -317,7 +320,7 @@ > } else { > drv = NULL; > } > - if (bdrv_open2(bs, filename, 0, drv) < 0) { > + if (bdrv_open2(bs, filename, BRDV_O_FLAGS, drv) < 0) { > error("Could not open '%s'", filename); > } > ret = bdrv_commit(bs); > @@ -691,7 +694,7 @@ > } else { > drv = NULL; > } > - if (bdrv_open2(bs, filename, 0, drv) < 0) { > + if (bdrv_open2(bs, filename, BRDV_O_FLAGS, drv) < 0) { > error("Could not open '%s'", filename); > } > bdrv_get_format(bs, fmt_name, sizeof(fmt_name)); > > > > >