From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=45899 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBrEB-00008o-W6 for qemu-devel@nongnu.org; Tue, 11 May 2010 11:18:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OBrEA-00079g-Ay for qemu-devel@nongnu.org; Tue, 11 May 2010 11:18:35 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38534 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBrEA-00079W-2J for qemu-devel@nongnu.org; Tue, 11 May 2010 11:18:34 -0400 Message-ID: <4BE97545.80701@suse.de> Date: Tue, 11 May 2010 17:18:29 +0200 From: Alexander Graf MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH 2/2] Add flush=off parameter to -drive References: <1273528310-7051-1-git-send-email-agraf@suse.de> <4BE91708.7050307@redhat.com> <20100511105559.GA21363@lst.de> <201005111315.08897.paul@codesourcery.com> In-Reply-To: <201005111315.08897.paul@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: Kevin Wolf , armbru@redhat.com, qemu-devel@nongnu.org, Christoph Hellwig Paul Brook wrote: >>> 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. > How about cache=insecure? But I agree. Having that as a cache= option seems to be the easiest way to expose it to a user. Alex