Re: open(O_DIRECT) on a tmpfs?
From: Helge Hafting
Date: Fri Jan 05 2007 - 09:49:27 EST
Hugh Dickins wrote:
On Thu, 4 Jan 2007, Hua Zhong wrote:
So I'd argue that it makes more sense to support O_DIRECT
on tmpfs as the memory IS the backing store.
A few more voices in favour and I'll be persuaded. Perhaps I'm
out of date: when O_DIRECT came in, just a few filesystems supported
it, and it was perfectly normal for open O_DIRECT to be failed; but
I wouldn't want tmpfs to stand out now as a lone obstacle.
Having tmpfs suppoting O_DIRECT makes sense.
For me, O_DIRECT says "write directly to the device
and don't return till its done." Which is what tmpfs
always do anyway.
The support could probably be as simple as ignoring
the flag entirely, mask it away in open() or something like that.
Arguments about "O_DIRECT says don't cache it and tmpfs
_is_ the cache" don't work. O_DIRECT says "write straight
to the device" and the device just happens to be pagecache
memory. The tmpfs file sure isn't cached elsewhere in
addition to its tmpfs pages.
Helge Hafting
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/