From: Anthony Liguori <anthony@codemonkey.ws>
To: Christoph Hellwig <hch@infradead.org>
Cc: Michael Tokarev <mjt@tls.msk.ru>, KVM list <kvm@vger.kernel.org>,
Kevin Wolf <kwolf@redhat.com>
Subject: Re: JFYI: ext4 bug triggerable by kvm
Date: Tue, 17 Aug 2010 09:20:37 -0500 [thread overview]
Message-ID: <4C6A9AB5.6050404@codemonkey.ws> (raw)
In-Reply-To: <20100817130702.GA16635@infradead.org>
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.
> It has nothing to do with the qemu caching
> mode - for data=writeback or none it's commited as part of the fdatasync
> call, and for data=writethrough it's commited as part of the O_SYNC
> write. Note that both these path end up calling the filesystems ->fsync
> method which is what's require to make writes stable. That's exactly
> what is missing out in sync_file_range, and that's why that API is not
> useful at all for data integrity operations.
For normal writes from a guest, we don't need to follow the write with
an fsync(). We should only need to issue an fsync() given an explicit
flush from the guest.
> It's also what makes
> fsync slow on extN - but the fix to that is not to not provide data
> integrity but rather to make fsync fast. There's various other
> filesystems that can already do it, and if you insist on using those
> that are slow for this operation you'll have to suffer until that
> issue is fixed for them.
>
fsync() being slow is orthogonal to my point. I don't see why we need
to do an fsync() on *every* write. It should only be necessary when a
guest injects an actual barrier.
Regards,
Anthony Liguori
next prev parent reply other threads:[~2010-08-17 14:20 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-16 14:00 JFYI: ext4 bug triggerable by kvm Michael Tokarev
2010-08-16 14:43 ` Anthony Liguori
2010-08-16 18:42 ` Christoph Hellwig
2010-08-16 20:34 ` Anthony Liguori
2010-08-17 9:07 ` Christoph Hellwig
2010-08-17 9:23 ` Avi Kivity
2010-08-17 11:17 ` Christoph Hellwig
2010-08-17 12:56 ` Anthony Liguori
2010-08-17 13:07 ` Christoph Hellwig
2010-08-17 14:20 ` Anthony Liguori [this message]
2010-08-17 14:28 ` Christoph Hellwig
2010-08-17 14:39 ` Anthony Liguori
2010-08-17 14:45 ` Christoph Hellwig
2010-08-17 14:53 ` Avi Kivity
2010-08-17 14:54 ` Anthony Liguori
2010-08-17 15:01 ` Avi Kivity
2010-08-17 15:02 ` Christoph Hellwig
2010-08-17 14:40 ` Michael Tokarev
2010-08-17 14:44 ` Anthony Liguori
2010-08-17 14:46 ` Christoph Hellwig
2010-08-17 14:57 ` Anthony Liguori
2010-08-17 14:59 ` Avi Kivity
2010-08-17 15:04 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C6A9AB5.6050404@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=hch@infradead.org \
--cc=kvm@vger.kernel.org \
--cc=kwolf@redhat.com \
--cc=mjt@tls.msk.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.