From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52274 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oxm8j-000664-Om for qemu-devel@nongnu.org; Mon, 20 Sep 2010 15:35:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oxm8i-0000JH-L3 for qemu-devel@nongnu.org; Mon, 20 Sep 2010 15:35:01 -0400 Received: from verein.lst.de ([213.95.11.210]:54067) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oxm8i-0000Ig-8w for qemu-devel@nongnu.org; Mon, 20 Sep 2010 15:35:00 -0400 Date: Mon, 20 Sep 2010 21:34:51 +0200 From: Christoph Hellwig Message-ID: <20100920193451.GA11516@lst.de> References: <4C97916E.2080801@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C97916E.2080801@codemonkey.ws> Subject: [Qemu-devel] Re: Caching modes List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Kevin Wolf , qemu-devel , Christoph Hellwig On Mon, Sep 20, 2010 at 11:53:02AM -0500, Anthony Liguori wrote: > cache=none > > All read and write requests SHOULD avoid any type of caching in the > host. Any write request MUST complete after the next level of storage > reports that the write request has completed. A flush from the guest > MUST complete after all pending I/O requests for the guest have been > completed. > > As an implementation detail, with the raw format, these guarantees are > only in place for preallocated images. Sparse images do not provide as > strong of a guarantee. That's not how cache=none ever worked nor works currently. But discussion the current cache modes is rather mood as they try to map multi-dimension behaviour difference into a single options. I have some patches that I need to finish up a bit more that will give you your no caching enabled mode, but I don't think mapping cache=none to it will do anyone a favour. With the split between the guest visible write-cache-enable (WCE) flag, and the host-specific "use O_DIRECT" and "ignore cache flushes" flags we'll get the following modes: | WC enable | WC disable ----------------------------------------------- direct | | buffer | | buffer + ignore flush | | currently we only have: cache=none direct + WC enable cache=writeback buffer + WC enable cache=writethrough buffer + WC disable cache=unsafe buffer + ignore flush + WC enable splitting these up is important because we want to migrate between hosts that can support direct I/O or not without requiring guest visible state changes, and also because we want to use direct I/O with guest that were installed using cache=unsafe without stopping the guest. It also allows the guest to change the WC enable/disable flag, which they can do for real IDE/SCSI hardware. And it allows Anthony's belowed no caching at all mode, which actually is useful for guest that can not deal with volatile write caches.