From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: JFYI: ext4 bug triggerable by kvm Date: Tue, 17 Aug 2010 09:39:15 -0500 Message-ID: <4C6A9F13.9030104@codemonkey.ws> References: <4C694483.5010903@msgid.tls.msk.ru> <4C694E7D.3060600@codemonkey.ws> <20100816184237.GA16579@infradead.org> <4C69A0C4.2080102@codemonkey.ws> <20100817090755.GA11110@infradead.org> <4C6A86E4.9080600@codemonkey.ws> <20100817130702.GA16635@infradead.org> <4C6A9AB5.6050404@codemonkey.ws> <20100817142808.GA22412@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Michael Tokarev , KVM list , Kevin Wolf To: Christoph Hellwig Return-path: Received: from mail-gy0-f174.google.com ([209.85.160.174]:47416 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751955Ab0HQOjU (ORCPT ); Tue, 17 Aug 2010 10:39:20 -0400 Received: by gyd8 with SMTP id 8so17337gyd.19 for ; Tue, 17 Aug 2010 07:39:19 -0700 (PDT) In-Reply-To: <20100817142808.GA22412@infradead.org> Sender: kvm-owner@vger.kernel.org List-ID: On 08/17/2010 09:28 AM, Christoph Hellwig wrote: > On Tue, Aug 17, 2010 at 09:20:37AM -0500, Anthony Liguori wrote: > >> On 08/17/2010 08:07 AM, Christoph Hellwig wrote: >> >>>> The point is that we don't want to flush the disk write cache. The >>>> intention of writethrough is not to make the disk cache writethrough >>>> but to treat the host's cache as writethrough. >>>> >>> We need to make sure data is not in the disk write cache if want to >>> provide data integrity. >>> >> When the guest explicitly flushes the emulated disk's write cache. >> Not on every single write completion. >> > That depends on the cache= mode. For cache=none and cache=writeback > we present a write-back cache to the guest, and the guest does explicit > cache flushes. For cache=writethrough we present a writethrough cache > to the guest, and we need to make sure data actually has hit the disk > before returning I/O completion to the guest. > Why? The type of cache we present to the guest only should relate to how the hypervisor caches the storage. It should be independent of how data is cached by the disk. There can be many levels of caching in a storage hierarchy and each hierarchy cached independently of the next level. If the user has a disk with a writeback cache, if we expose a writethrough cache to the guest, it's not our responsibility to make sure that we break through the writeback cache on the disk. Regards, Anthony Liguori