From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56962 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBoTP-0003lM-8p for qemu-devel@nongnu.org; Tue, 11 May 2010 08:22:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OBoTK-0001kl-AH for qemu-devel@nongnu.org; Tue, 11 May 2010 08:22:03 -0400 Received: from mail.codesourcery.com ([38.113.113.100]:39394) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBoTJ-0001kV-SA for qemu-devel@nongnu.org; Tue, 11 May 2010 08:22:02 -0400 From: Paul Brook Subject: Re: [Qemu-devel] Re: [PATCH 2/2] Add flush=off parameter to -drive Date: Tue, 11 May 2010 13:15:08 +0100 References: <1273528310-7051-1-git-send-email-agraf@suse.de> <4BE91708.7050307@redhat.com> <20100511105559.GA21363@lst.de> In-Reply-To: <20100511105559.GA21363@lst.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201005111315.08897.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , armbru@redhat.com, Christoph Hellwig , Alexander Graf > > What about another cache=... value instead of adding more options? I'm > > quite sure you'll only ever need this with writeback caching. So we > > could have cache=none|writethrough|writeback|wb-noflush or something > > like that. I agree. > The cache option really isn't too useful. There's a matrix of 3x2 > possible I/O modes for the posix backend, and right now we only expose > two of them. I think we really should expose all of them, split into > two options: > > caching > > | normal | O_DIRECT | > > --------+--------------------+--------------------+ > none | - | - | > integrity O_DSYNC | cache=writeback | - | > fsync | cache=writethrough | cache=none | > --------+--------------------+--------------------+ I think this table is misleading, and from a user perspective there are only 4 interesting combinations: cache=none: No host caching. Reads and writes both go directly to underlying storage. Useful to avoid double-caching. cache=writethrough Reads are cached. Writes go directly to underlying storage. Useful for broken guests that aren't aware of drive caches. cache=writeback Reads and writes are cached. Guest flushes are honoured. Note that this may include a guest visible knob that allows the write cache to be disabled. If the guest requests the cache be disabled then this should act the same as cache=writethrough. Closest to how real hardware works. cache=always (or a more scary name like cache=lie to defend against idiots) Reads and writes are cached. Guest flushes are ignored. Useful for dumb guests in non-critical environments. IMO the other boxes in your table (disable cache but require guest flushes) don't make any sense. Paul