From: Jens Axboe <qemu@kernel.dk>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] bdrv_aio_flush
Date: Tue, 2 Sep 2008 16:25:24 +0200 [thread overview]
Message-ID: <20080902142523.GH20055@kernel.dk> (raw)
In-Reply-To: <18621.6888.630519.634369@mariner.uk.xensource.com>
On Tue, Sep 02 2008, Ian Jackson wrote:
> Andrea Arcangeli writes ("Re: [Qemu-devel] [PATCH] bdrv_aio_flush"):
> > In case you meant fsync is just fine, Linux will use the
> > WIN_FLUSH_CACHE/WIN_FLUSH_CACHE_EXT see
> > idedisk_prepare_flush:
> >
> > if (barrier) {
> > ordered = QUEUE_ORDERED_DRAIN_FLUSH;
> > prep_fn = idedisk_prepare_flush;
> > }
>
> I'm not sure I follow but I'm not familiar with the relevant Linux
> code. Do you mean that Linux does this
>
> submit IO 1 to device
> submit flush to device
> collect IO 1 completion
> collect flush completion
>
> and then expects IO 1 to be on disk ?
Given that this case refers to PATA/SATA and that you can't queue the
flush operation, it looks something like:
submit IO 1 to device
IO 1 completes
submit flush
flush completes
and at this point, flush completion either ends in error (in which case
we can't rely on IO 1 being safely stored), or it suceeds and Linux then
expects IO 1 to be on disk. If it isn't, then the device is broken (as
simple as that).
> If this is a documented behaviour of the controller or device we're
> emulating then I think the qemu emulation (hw/scsi-disk.c or whatever)
> should do an aio_flush barrier before aio_fsync.
Certainly it is, when the flush command returns, all dirty drive cache
must be safely on platter.
> What spec should I be referring to ?
ata spec, see t13.org
> Perhaps I'm naive but I would expect the device interface to look more
> like the kernel syscall interface, whose specification text (in SuSv3)
> I analysed in April in
> http://lists.nongnu.org/archive/html/qemu-devel/2008-04/msg00046.html
>
> Ian.
>
>
--
Jens Axboe
next prev parent reply other threads:[~2008-09-02 14:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-29 13:37 [Qemu-devel] [PATCH] bdrv_aio_flush Andrea Arcangeli
2008-09-01 11:27 ` Ian Jackson
2008-09-01 12:25 ` Andrea Arcangeli
2008-09-01 13:54 ` Jamie Lokier
2008-09-02 10:52 ` Ian Jackson
2008-09-02 14:25 ` Jens Axboe [this message]
2008-09-02 16:49 ` Ian Jackson
2008-09-01 13:25 ` Jamie Lokier
2008-09-02 10:46 ` Ian Jackson
2008-09-02 14:28 ` Jens Axboe
2008-09-02 16:52 ` Ian Jackson
2008-09-02 18:22 ` Jamie Lokier
2008-09-03 10:01 ` Ian Jackson
2008-09-02 18:01 ` Jamie Lokier
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=20080902142523.GH20055@kernel.dk \
--to=qemu@kernel.dk \
--cc=qemu-devel@nongnu.org \
/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.