qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Orit Wasserman <owasserm@redhat.com>
To: "Marcin Gibuła" <m.gibula@beyond.pl>,
	"Alexey Kardashevskiy" <aik@ozlabs.ru>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] migration question: disk images on nfs server
Date: Fri, 07 Feb 2014 15:36:30 +0200	[thread overview]
Message-ID: <52F4E15E.3020109@redhat.com> (raw)
In-Reply-To: <52F4D778.6070001@beyond.pl>

On 02/07/2014 02:54 PM, Marcin Gibuła wrote:
>> It is more a NFS issue, if you have a file in NFS that two users in
>> two different host are accessing (one at least write to it) you will
>> need to enforce the "sync" option.
>> Even if you flush all the data and close the file the NFS client can still
>> have cached data that it didn't sync to the server.
>
> Do you know if is applies to linux O_DIRECT writes as well?
>

 From the man of open:

        The behaviour of O_DIRECT with NFS will differ from local
        filesystems.  Older kernels, or kernels configured in certain ways,
        may not support this combination.  The NFS protocol does not support
        passing the flag to the server, so O_DIRECT I/O will bypass the page
        cache only on the client; the server may still cache the I/O.  The
        client asks the server to make the I/O synchronous to preserve the
        synchronous semantics of O_DIRECT.  Some servers will perform poorly
        under these circumstances, especially if the I/O size is small.  Some
        servers may also be configured to lie to clients about the I/O having
        reached stable storage; this will avoid the performance penalty at
        some risk to data integrity in the event of server power failure.
        The Linux NFS client places no alignment restrictions on O_DIRECT
        I/O.
  
To summaries it depends on your kernel (NFS client).


>  From comment in fs/nfs/direct.c:
>
> * When an application requests uncached I/O, all read and write requests
> * are made directly to the server; data stored or fetched via these
> * requests is not cached in the Linux page cache.  The client does not
> * correct unaligned requests from applications.  All requested bytes are
> * held on permanent storage before a direct write system call returns to
> * an application.
>

>
>

  reply	other threads:[~2014-02-07 13:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-07  4:35 [Qemu-devel] migration question: disk images on nfs server Alexey Kardashevskiy
2014-02-07  7:46 ` Orit Wasserman
2014-02-07  9:41   ` Marcin Gibuła
2014-02-07 12:26     ` Paolo Bonzini
2014-02-07 12:10   ` Alexey Kardashevskiy
2014-02-07 12:47     ` Orit Wasserman
2014-02-07 12:54       ` Marcin Gibuła
2014-02-07 13:36         ` Orit Wasserman [this message]
2014-02-07 13:44           ` Marcin Gibuła
2014-02-07 13:57             ` Orit Wasserman
2014-02-08  8:30       ` Kevin Wolf

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=52F4E15E.3020109@redhat.com \
    --to=owasserm@redhat.com \
    --cc=aik@ozlabs.ru \
    --cc=m.gibula@beyond.pl \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).