From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:36546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qbvce-0000x2-DU for Qemu-devel@nongnu.org; Wed, 29 Jun 2011 10:20:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qbvcc-0002ye-U4 for Qemu-devel@nongnu.org; Wed, 29 Jun 2011 10:20:08 -0400 Received: from mail-gx0-f173.google.com ([209.85.161.173]:52900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qbvcc-0002yJ-Ir for Qemu-devel@nongnu.org; Wed, 29 Jun 2011 10:20:06 -0400 Received: by gxk26 with SMTP id 26so560920gxk.4 for ; Wed, 29 Jun 2011 07:20:06 -0700 (PDT) Message-ID: <4E0B3493.4080706@codemonkey.ws> Date: Wed, 29 Jun 2011 09:20:03 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <4E0B1399.4050807@redhat.com> <4E0B15B2.40504@codemonkey.ws> <20110629135545.GD15863@lst.de> In-Reply-To: <20110629135545.GD15863@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Default cache mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: Kevin Wolf , Avi Kivity , Qemu-devel@nongnu.org, Stefan Hajnoczi On 06/29/2011 08:55 AM, Christoph Hellwig wrote: > On Wed, Jun 29, 2011 at 07:08:18AM -0500, Anthony Liguori wrote: >> As long as we advertise wce and wce can be toggled from the guest, I don't >> think the default is all that important. I think cache=on is the right >> default for most common use cases. > > What do you mean with cache=on? Sorry, I meant having a new cache option (maybe diskcache). Semantics would be: diskcache=on,wce=on 0 diskcache=on,wce=off O_SYNC diskcache=off,wce=on O_DIRECT diskcache=off,wce=off O_DIRECT | O_SYNC ignore_flush could be another option too. > We have > cache=[none,writeback,writethrough,unsafe]. As discussed about a dozen > times before these are an incomplete choice of the [odirect=on,off; > osync=on,off, ignore cache flushes=on,off] matrix. Yup, I agree that we need to deprecate cache=[none,writeback,writethrough,unsafe] and add more meaningful tunables. > Not using O_DIRECT when it is available is almost always the wrong choice. > It means an additional data copy, VM pressure and exercise of often suck > fsync/O_SYNC codepatheses, with only a benefit if you have multiple VMs > actually using the same dataset with the same COW backing image. Can we set globals for -drive via -readconfig? If so, we could defer the default value to a config file setting which I think would be the best possible scenario. I think developers usually want diskcache=on but I also agree that usually in production, you want diskcache=off. Regards, Anthony Liguori