All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Alex Bligh <alex@alex.org.uk>
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	qemu-devel@nongnu.org, xen-devel <xen-devel@lists.xen.org>,
	Anthony Liguori <anthony@codemonkey.ws>
Subject: Re: [PATCHv3] QEMU(upstream): Disable xen's use of O_DIRECT by default as it results in crashes.
Date: Mon, 18 Mar 2013 15:49:48 +0100	[thread overview]
Message-ID: <5147298C.8080900__43493.7784601518$1363618335$gmane$org@redhat.com> (raw)
In-Reply-To: <6D0F4ACDA3B7FCF1A50F8B52@Ximines.local>

Il 18/03/2013 15:30, Alex Bligh ha scritto:
> Paolo,
> 
> --On 18 March 2013 15:05:08 +0100 Paolo Bonzini <pbonzini@redhat.com>
> wrote:
> 
>>> Presumably the same way as if writeback caching is selected. I presume
>>> that must fsync() / fdatasync() all the data to disk, and a barrier will
>>> produce one of those.
>>
>> No, that's done already.  The source does an fsync/fdatasync before
>> terminating the migration.
>>
>> The problem is that the target's page cache might host image data from a
>> previous run.  If you do not use O_DIRECT, it will not see the changes
>> made on the source.
> 
> I was under the impression that with cache=writeback, qemu doesn't
> use O_DIRECT, in which case why isn't there the same danger under
> kvm, i.e. that the target page cache contains data from a previous
> run?

KVM in fact only supports migration using cache=none.  This does not
apply of course if you're using cache-coherent storage, such as rbd or
gluster; or if you're using one of the userspace backends that bypass
the page cache, like NBD or libiscsi.

> Disabling migration seems a bit excessive when migration isn't disabled
> with cache=unsafe (AFAIK)

It is not QEMU's task.  There are cases where the cache= options are
unnecessary or ignored.  But indeed libvirt warns (or blocks, I don't
remember) in this case.

> , and the alternative (using O_DIRECT)
> is far far more unsafe (one tcp retransmit and your system is dead).
> 
>> 1) why does blkback not have the bug?
>>
>> 2) does it also affect virtio disks (or perhaps AHCI too)?  I think
>> Stefano experimented with virtio in Xen.  If it does, then you're
>> working around the problem in the wrong place.
> 
> I believe it affects PV disks and not emulated disks as emulated disks
> under Xen do not use O_DIRECT (despite migration apparently working
> notwithstanding your comment above).

If libxl does migration without O_DIRECT, then that's a bug in libxl.
What about blkback?  IIRC it uses bios, so it also bypasses the page cache.

> Stefano did ack the patch, and for a one line change it's been
> through a pretty extensive discussion on xen-devel ...

It may be a one-line change, but it completely changes the paths that
I/O goes through.  Apparently the discussion was not enough.

> I've no idea what else it affects. I'd suggest it also affects kvm,
> save that the kvm 'bad' will be writing the wrong data, not hosing
> the whole machine.
> 

  parent reply	other threads:[~2013-03-18 14:49 UTC|newest]

Thread overview: 123+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-18 12:18 [Qemu-devel] [PATCHv3] QEMU(upstream): Disable xen's use of O_DIRECT by default as it results in crashes Alex Bligh
2013-03-18 12:18 ` Alex Bligh
2013-03-18 13:03 ` [Qemu-devel] " Stefan Hajnoczi
2013-03-18 13:03 ` Stefan Hajnoczi
2013-03-18 13:19   ` Alex Bligh
2013-03-18 13:32 ` Paolo Bonzini
2013-03-18 13:49   ` Alex Bligh
2013-03-18 13:49   ` Alex Bligh
2013-03-18 14:05     ` Paolo Bonzini
2013-03-18 14:30       ` Alex Bligh
2013-03-18 14:49         ` Paolo Bonzini
2013-03-18 15:40           ` Alex Bligh
2013-03-18 15:40           ` [Qemu-devel] " Alex Bligh
2013-03-18 16:19             ` Paolo Bonzini
2013-03-18 16:19             ` [Qemu-devel] " Paolo Bonzini
2013-03-18 16:53               ` Alex Bligh
2013-03-18 16:53                 ` Alex Bligh
2013-03-18 17:38                 ` [Qemu-devel] " George Dunlap
2013-03-18 17:38                   ` George Dunlap
2013-03-18 17:47                   ` [Qemu-devel] " Alex Bligh
2013-03-18 17:47                     ` Alex Bligh
2013-03-18 18:00                   ` [Qemu-devel] " Paolo Bonzini
2013-03-19 10:06                     ` George Dunlap
2013-03-19 10:06                     ` [Qemu-devel] [Xen-devel] " George Dunlap
2013-03-19 10:43                       ` Paolo Bonzini
2013-03-19 10:43                       ` [Qemu-devel] [Xen-devel] " Paolo Bonzini
2013-03-19 10:51                         ` George Dunlap
2013-03-19 11:14                           ` Paolo Bonzini
2013-03-19 11:14                           ` [Qemu-devel] [Xen-devel] " Paolo Bonzini
2013-03-19 11:21                             ` George Dunlap
2013-03-19 11:21                               ` George Dunlap
2013-03-19 15:12                               ` George Dunlap
2013-03-19 15:12                               ` [Qemu-devel] [Xen-devel] " George Dunlap
2013-03-19 15:29                                 ` George Dunlap
2013-03-19 15:29                                 ` [Qemu-devel] [Xen-devel] " George Dunlap
2013-03-19 19:15                                   ` [Qemu-devel] " Alex Bligh
2013-03-19 19:15                                   ` [Qemu-devel] [Xen-devel] " Alex Bligh
2013-03-20 10:24                                     ` Stefano Stabellini
2013-03-20 10:37                                       ` [Qemu-devel] " George Dunlap
2013-03-20 10:37                                       ` [Qemu-devel] [Xen-devel] " George Dunlap
2013-03-20 11:08                                         ` Paolo Bonzini
2013-03-20 11:20                                           ` Alex Bligh
2013-03-20 11:20                                           ` [Qemu-devel] [Xen-devel] " Alex Bligh
2013-03-20 11:08                                         ` Paolo Bonzini
2013-03-20 11:57                                       ` [Qemu-devel] [Xen-devel] " David Scott
2013-03-20 11:57                                         ` [Qemu-devel] " David Scott
2013-03-20 10:24                                     ` Stefano Stabellini
2013-03-19 11:44                             ` [Qemu-devel] [Xen-devel] " Alex Bligh
2013-03-19 11:49                               ` Paolo Bonzini
2013-03-19 11:49                               ` [Qemu-devel] [Xen-devel] " Paolo Bonzini
2013-03-19 11:44                             ` Alex Bligh
2013-03-19 10:51                         ` George Dunlap
2013-03-19 15:13                         ` [Qemu-devel] [Xen-devel] " Stefano Stabellini
2013-03-19 16:53                           ` Paolo Bonzini
2013-03-19 17:03                             ` Stefano Stabellini
2013-03-19 17:03                             ` Stefano Stabellini
2013-03-19 16:53                           ` Paolo Bonzini
2013-03-20  8:33                           ` [Qemu-devel] [Xen-devel] " Alex Bligh
2013-03-20  8:33                             ` Alex Bligh
2013-03-20  9:26                             ` Paolo Bonzini
2013-03-20  9:26                             ` [Qemu-devel] [Xen-devel] " Paolo Bonzini
2013-03-29 17:19                               ` Stefano Stabellini
2013-03-29 17:19                                 ` Stefano Stabellini
2013-03-31 19:53                                 ` Alex Bligh
2013-03-31 19:53                                 ` [Qemu-devel] [Xen-devel] " Alex Bligh
2013-04-01 15:32                                   ` [Qemu-devel] [PATCH] [RFC] Xen PV backend: Move call to bdrv_new from blk_init to blk_connect Alex Bligh
2013-04-01 15:32                                     ` Alex Bligh
2013-04-01 15:44                                     ` [Qemu-devel] " Stefano Stabellini
2013-04-01 20:56                                       ` Alex Bligh
2013-04-01 20:56                                       ` [Qemu-devel] " Alex Bligh
2013-04-02 11:08                                         ` Stefano Stabellini
2013-04-02 11:08                                         ` [Qemu-devel] " Stefano Stabellini
2013-04-05 10:31                                           ` [PATCHv2 1/2] " Alex Bligh
2013-04-05 10:31                                           ` [Qemu-devel] " Alex Bligh
2013-04-05 10:31                                             ` [PATCHv2 2/2] Xen PV backend: Disable use of O_DIRECT by default as it results in crashes Alex Bligh
2013-04-05 10:31                                             ` [Qemu-devel] " Alex Bligh
2013-04-05 14:22                                             ` [PATCHv2 1/2] Xen PV backend: Move call to bdrv_new from blk_init to blk_connect Stefano Stabellini
2013-04-05 14:22                                             ` [Qemu-devel] " Stefano Stabellini
2013-04-05 15:42                                               ` [PATCHv3 " Alex Bligh
2013-04-05 15:42                                               ` [Qemu-devel] " Alex Bligh
2013-04-05 15:42                                                 ` [PATCHv3 2/2] Xen PV backend: Disable use of O_DIRECT by default as it results in crashes Alex Bligh
2013-04-05 15:42                                                 ` [Qemu-devel] " Alex Bligh
2013-04-05 15:43                                               ` [Qemu-devel] [PATCHv2 1/2] Xen PV backend: Move call to bdrv_new from blk_init to blk_connect Alex Bligh
2013-04-05 15:43                                               ` Alex Bligh
2013-04-05 10:32                                           ` [PATCHv2 1/2] Xen PV backend (for qemu-upstream-4.2-testing): " Alex Bligh
2013-04-05 10:32                                           ` [Qemu-devel] " Alex Bligh
2013-04-05 10:32                                             ` [PATCHv2 2/2] Xen PV backend (for qemu-upstream-4.2-testing): Disable use of O_DIRECT by default as it results in crashes Alex Bligh
2013-04-05 10:32                                             ` [Qemu-devel] " Alex Bligh
2013-04-05 10:34                                           ` [PATCH] [RFC] Xen PV backend: Move call to bdrv_new from blk_init to blk_connect Alex Bligh
2013-04-05 10:34                                           ` [Qemu-devel] " Alex Bligh
2013-04-01 15:44                                     ` Stefano Stabellini
2013-04-01 16:35                                   ` [Qemu-devel] [Xen-devel] [PATCHv3] QEMU(upstream): Disable xen's use of O_DIRECT by default as it results in crashes Alex Bligh
2013-04-01 16:35                                     ` Alex Bligh
2013-03-19 15:13                         ` Stefano Stabellini
2013-03-18 18:00                   ` Paolo Bonzini
2013-03-18 14:49         ` Paolo Bonzini [this message]
2013-03-18 14:30       ` [Qemu-devel] " Alex Bligh
2013-03-18 14:05     ` Paolo Bonzini
2013-03-18 13:32 ` Paolo Bonzini
  -- strict thread matches above, loose matches on Subject: below --
2013-03-08 11:18 [PATCH] " George Dunlap
2013-03-08 11:40 ` [PATCHv3] " Alex Bligh
2013-03-08 12:54   ` George Dunlap
2013-03-11 14:02     ` Alex Bligh
2013-03-11 14:42       ` George Dunlap
2013-03-11 17:48         ` Konrad Rzeszutek Wilk
2013-03-11 17:55           ` Ian Jackson
2013-03-14 17:06             ` Alex Bligh
2013-03-14 18:26               ` Ian Jackson
2013-03-12 12:08         ` Ian Campbell
2013-03-14 18:37   ` Stefano Stabellini
2013-03-14 19:30     ` Ian Jackson
2013-03-14 19:56       ` Alex Bligh
2013-03-15  9:28       ` Ian Campbell
2013-03-15 10:43         ` Stefano Stabellini
2013-03-15 11:21           ` Ian Jackson
2013-03-15 11:28             ` Stefano Stabellini
2013-03-15 11:37               ` Ian Jackson
2013-03-15 11:43                 ` Stefano Stabellini
2013-03-15 12:43                   ` Alex Bligh
2013-03-15 12:50                     ` Ian Campbell
2013-03-15 18:31                   ` Ian Jackson
2013-03-18 10:29                   ` Alex Bligh
2013-03-18 11:47                     ` Stefano Stabellini
2013-03-18 12:21                       ` Alex Bligh

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='5147298C.8080900__43493.7784601518$1363618335$gmane$org@redhat.com' \
    --to=pbonzini@redhat.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=alex@alex.org.uk \
    --cc=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.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.