From: "Jesper Juhl" <jesper.juhl@gmail.com>
To: "Hua Zhong" <hzhong@gmail.com>
Cc: "Hugh Dickins" <hugh@veritas.com>,
"Bill Davidsen" <davidsen@tmr.com>,
Linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: open(O_DIRECT) on a tmpfs?
Date: Fri, 5 Jan 2007 15:59:41 +0100 [thread overview]
Message-ID: <9a8748490701050659r3715aa48j883c26201005d26c@mail.gmail.com> (raw)
In-Reply-To: <9a8748490701050658n39f82791yb3d2e3c80f237a7e@mail.gmail.com>
On 05/01/07, Jesper Juhl <jesper.juhl@gmail.com> wrote:
> On 04/01/07, Hua Zhong <hzhong@gmail.com> wrote:
> > > I see that as a good argument _not_ to allow O_DIRECT on
> > > tmpfs, which inevitably impacts cache, even if O_DIRECT were
> > > requested.
> > >
> > > But I'd also expect any app requesting O_DIRECT in that way,
> > > as a caring citizen, to fall back to going without O_DIRECT
> > > when it's not supported.
> >
> > According to "man 2 open" on my system:
> >
> > O_DIRECT
> > Try to minimize cache effects of the I/O to and from this file.
> > In general this will degrade performance, but it is useful in
> > special situations, such as when applications do their own
> > caching. File I/O is done directly to/from user space buffers.
> > The I/O is synchronous, i.e., at the completion of the read(2)
> > or write(2) system call, data is guaranteed to have been trans-
> > ferred. Under Linux 2.4 transfer sizes, and the alignment of
> > user buffer and file offset must all be multiples of the logi-
> > cal block size of the file system. Under Linux 2.6 alignment to
> > 512-byte boundaries suffices.
> > A semantically similar interface for block devices is described
> > in raw(8).
> >
> > This says nothing about (probably disk based) persistent backing store. I don't see why tmpfs has to conflict with it.
> >
> > So I'd argue that it makes more sense to support O_DIRECT on tmpfs as the memory IS the backing store.
> >
>
> I'd agree. O_DIRECT means data will go direct to backing store, so if
> RAM *is* the backing store as in the tmpfs case, then I see why
> O_DIRECT should fail for it...
>
Whoops, that should of course have read " then I *DON'T* see why
O_DIRECT should fail" .
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
next prev parent reply other threads:[~2007-01-05 14:59 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-04 11:52 Michael Tokarev
2007-01-04 13:08 ` Hugh Dickins
2007-01-04 16:19 ` Bill Davidsen
2007-01-04 17:09 ` Hugh Dickins
2007-01-04 17:54 ` Peter Staubach
2007-01-04 18:11 ` Bill Davidsen
2007-01-04 18:41 ` Hua Zhong
2007-01-04 19:14 ` Hugh Dickins
2007-01-04 19:35 ` Mark Lord
2007-01-05 6:57 ` Chen, Kenneth W
2007-01-05 14:38 ` Helge Hafting
2007-01-05 14:58 ` Jesper Juhl
2007-01-05 14:59 ` Jesper Juhl [this message]
2007-01-04 22:17 ` Denis Vlasenko
2007-01-05 5:30 ` Nick Piggin
2007-01-05 16:20 ` Bill Davidsen
2007-01-06 0:30 ` Denis Vlasenko
2007-01-08 19:42 ` Bill Davidsen
2007-01-05 11:49 ` Michael Tokarev
[not found] <7zzqw-SS-27@gated-at.bofh.it>
2007-01-04 14:47 ` Bodo Eggert
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=9a8748490701050659r3715aa48j883c26201005d26c@mail.gmail.com \
--to=jesper.juhl@gmail.com \
--cc=davidsen@tmr.com \
--cc=hugh@veritas.com \
--cc=hzhong@gmail.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®