linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* open(O_DIRECT) on a tmpfs?
@ 2007-01-04 11:52 Michael Tokarev
  2007-01-04 13:08 ` Hugh Dickins
  0 siblings, 1 reply; 20+ messages in thread
From: Michael Tokarev @ 2007-01-04 11:52 UTC (permalink / raw)
  To: Linux-kernel

I wonder why open() with O_DIRECT (for example) bit set is
disallowed on a tmpfs (again, for example) filesystem,
returning EINVAL.

Yes, the question may seems strange a bit, because of two
somewhat conflicting reasons.  First, there's no reason to
use O_DIRECT with tmpfs in a first place, because tmpfs does
not have backing store at all, so there's no place to do
direct writes to.  But on another hand, again due to the very
nature of tmpfs, there's no reason not to allow O_DIRECT
open and just ignore it, -- exactly because there's no
backing store for this filesystem.

Why I'm asking is:  Currently I'm trying to evaluate a disk
subsystem for large loaded database (currently running with
Oracle, but there's no reason not to try Mysql or Postgres -
the stuff below equally applies to any database).

Almost any database uses two different I/O patterns for two
different kinds of files.  They are - regular data files, with
mostly random relatively large-block I/O, and control+redolog
files, which are small and receives very many relatively small
updates.

The same two kinds of load (large random I/O and small I/O)
applies to any journalling filesystem too, and even to linux
software raid devices.

I was thinking about trying to place those small redolog files
which receives alot of small updates to a battery-backed RAM.
The reason is simple: with fast I/O subsystem (composed of many
spindles, nicely distributed and so on), those redo-log files,
which can not be distributed, becomes real bottleneck.

But since such devices - battery-backed RAM - are relatively
expensive, I want to see how it works BEFORE buying a real
device.  So I just placed the redo-log files into a tmpfs,
because that's the most close "alternative", and tried to
start a database.  And it failed.

Failed because it rightly tries to open all the files with
O_DIRECT flag set, including control and redolog files.  And
tmpfs returns EINVAL.

Ok, I was able to work around this.. "issue" by creating a
loop device on a file residing on a tmpfs, creating a filesystem
on it and placing my files there.

But the original question remains...  Why tmpfs and similar
filesystems disallows O_DIRECT opens?

Thanks.

/mjt

^ permalink raw reply	[flat|nested] 20+ messages in thread
[parent not found: <7zzqw-SS-27@gated-at.bofh.it>]

end of thread, other threads:[~2007-01-08 19:42 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-04 11:52 open(O_DIRECT) on a tmpfs? 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
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

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).