linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <esandeen@redhat.com>
To: Jan Kara <jack@suse.cz>, Jeff Moyer <jmoyer@redhat.com>
Cc: Lukas Czerner <lczerner@redhat.com>,
	linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk,
	Christoph Hellwig <hch@lst.de>
Subject: Re: Async direct IO write vs buffered read race
Date: Fri, 23 Jun 2017 13:04:40 -0500	[thread overview]
Message-ID: <8cdad0ee-aafb-5481-2f02-7c9535f81305@redhat.com> (raw)
In-Reply-To: <20170623075942.GC25149@quack2.suse.cz>

On 6/23/17 2:59 AM, Jan Kara wrote:
> On Thu 22-06-17 12:55:50, Jeff Moyer wrote:


>> Christoph or Jan, any thoughts on this?
> 
> So our stance has been: Do not ever mix buffered and direct IO! Definitely
> not on the same file range, most definitely not at the same time.

FWIW, I'd always known that concurrent buffered & direct wasn't
particularly deterministic, i.e. the racing buffered read may get old or
new data at the time.

I was surprised to learn that the stale file data would linger
indefinitely in the page cache though.  Maybe I was just blissfully
unaware.  :)

-Eric

> The thing we do is a best effort thing that more or less guarantees that if
> you do say buffered IO and direct IO after that, it will work reasonably.
> However if direct and buffered IO can race, bad luck for your data. I don't
> think we want to sacrifice any performance of AIO DIO (and offloading of
> direct IO completion to a workqueue so that we can do invalidation costs
> noticeable mount of performance) for supporting such usecase.
> 
> 								Honza
> 

      parent reply	other threads:[~2017-06-23 18:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-22 15:57 Async direct IO write vs buffered read race Lukas Czerner
2017-06-22 16:55 ` Jeff Moyer
2017-06-23  7:59   ` Jan Kara
2017-06-23 10:16     ` Lukas Czerner
2017-06-26 15:11       ` Jeff Moyer
2017-06-28 16:57         ` Rik van Riel
2017-06-30 11:16           ` Lukas Czerner
2017-06-23 18:04     ` Eric Sandeen [this message]

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=8cdad0ee-aafb-5481-2f02-7c9535f81305@redhat.com \
    --to=esandeen@redhat.com \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=jmoyer@redhat.com \
    --cc=lczerner@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    /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).