From: Miklos Szeredi <miklos@szeredi.hu>
To: Miklos Szeredi <miklos@szeredi.hu>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Miklos Szeredi <mszeredi@redhat.com>
Subject: Re: [fuse] Effects of opening with O_DIRECT
Date: Tue, 10 Mar 2020 14:16:41 +0100 [thread overview]
Message-ID: <CAJfpegsALuMOxK_Bkry6Cwh76M5sihaJFVT36Z70BXO0FsEGKw@mail.gmail.com> (raw)
In-Reply-To: <8736aqv6uv.fsf@vostro.rath.org>
On Mon, Mar 2, 2020 at 9:29 PM Nikolaus Rath <Nikolaus@rath.org> wrote:
>
> On Mar 02 2020, Miklos Szeredi <miklos@szeredi.hu> wrote:
> > On Sun, Mar 1, 2020 at 2:20 PM Nikolaus Rath <Nikolaus@rath.org> wrote:
> >>
> >> Hi,
> >>
> >> What happens if a file (on a FUSE mountpoint) is opened without
> >> O_DIRECT, has some data in the page cache, and is then opened a second
> >> with O_DIRECT?
> >>
> >> Will reads with O_DIRECT come from the page cache (if there's a hit), or
> >> be passed through to the fuse daemon?
> >
> > O_DIRECT read will try first directly, and fall back to the cache on
> > short or zero return count.
> >
> >>
> >> What happens to writes (with and without O_DIRECT, and assuming that
> >> writeback caching is active)? It seems to me that in order to keep
> >> consistent, either caching has to be disabled for both file descriptors
> >> or enabled for both...
> >
> > This is not a fuse specific problem. The kernel will try to keep
> > things consistent by flushing dirty data before an O_DIRECT read.
> > However this mode of operation is not recommended. See open(2)
> > manpage:
> [...]
>
> Is there currently any other way to execute a read request while making
> sure that data does not end-up in the page cache (unless it happens to
> be there already)?
Hmm, that sounds something like posix_fadvise(..., POSIX_FADV_DONTNEED).
Thanks,
Miklos
prev parent reply other threads:[~2020-03-10 13:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-01 13:20 [fuse] Effects of opening with O_DIRECT Nikolaus Rath
2020-03-02 9:47 ` Miklos Szeredi
2020-03-02 20:28 ` Nikolaus Rath
2020-03-10 13:16 ` Miklos Szeredi [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=CAJfpegsALuMOxK_Bkry6Cwh76M5sihaJFVT36Z70BXO0FsEGKw@mail.gmail.com \
--to=miklos@szeredi.hu \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mszeredi@redhat.com \
/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).