From: Joel Becker <jlbec@evilplan.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Steve Lord <lord@sgi.com>, Chris Wedgwood <cw@f00f.org>,
Jeff Garzik <garzik@havoc.gtf.org>, Chris Mason <mason@suse.com>,
Andrea Arcangeli <andrea@suse.de>,
Andrew Morton <akpm@zip.com.au>, Ricardo Galli <gallir@uib.es>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: O_DIRECT fails in some kernel and FS
Date: Mon, 4 Feb 2002 18:29:42 +0000 [thread overview]
Message-ID: <20020204182942.C2092@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <1012835730.26397.519.camel@jen.americas.sgi.com> <E16XlK0-0007Wu-00@the-village.bc.nu>
In-Reply-To: <E16XlK0-0007Wu-00@the-village.bc.nu>; from alan@lxorguk.ukuu.org.uk on Mon, Feb 04, 2002 at 03:46:20PM +0000
On Mon, Feb 04, 2002 at 03:46:20PM +0000, Alan Cox wrote:
> > If an application is multithreaded and is doing mmap and direct I/O
> > from different threads without doing its own synchronization, then it
> > is broken, there is no ordering guarantee provided by the kernel as
> > to what happens first.
>
> Providing we don't allow asynchronous I/O with O_DIRECT once asynchronous
> I/O is merged.
Oh, but async + O_DIRECT is a good thing. The fundamental
ordering comes down at the block layer. Things are synchronous there.
An application using async I/O knows that ordering is not guaranteed.
Applications using O_DIRECT know they are skipping the buffer cache.
"Caveat emptor" and "Don't do that then" apply to stupid applications.
The big issues I see are O_DIRECT alignment size (see my patch
to allow hardsectsize alignment on O_DIRECT ops) and whether or not to
synchronize with the caches upon O_DIRECT write. Keeping the
page/buffer caches in sync with O_DIRECT writes is a bit of work,
especially with writes smaller than sb_blocksize. You can either do
that work, or you can say that applications and people using O_DIRECT
should know the caches might be inconsistent. Large O_DIRECT users,
such as databases, already know this. They are happily ignorant of
cache inconsistencies. All they care about is hardsectsize O_DIRECT
operations.
Joel
--
Life's Little Instruction Book #267
"Lie on your back and look at the stars."
http://www.jlbec.org/
jlbec@evilplan.org
next prev parent reply other threads:[~2002-02-04 18:30 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-01 20:37 Ricardo Galli
2002-02-01 20:44 ` Andrew Morton
2002-02-01 20:49 ` Ricardo Galli
2002-02-01 20:57 ` Andrew Morton
2002-02-02 17:14 ` Christoph Hellwig
2002-02-01 21:05 ` Steve Lord
2002-02-02 9:35 ` Chris Wedgwood
2002-02-02 10:25 ` Hans Reiser
2002-02-02 15:24 ` Chris Mason
2002-02-02 18:20 ` Chris Mason
2002-02-02 19:54 ` Andrea Arcangeli
2002-02-02 20:10 ` Chris Mason
2002-02-02 20:16 ` Stephen Lord
2002-02-02 20:50 ` Jeff Garzik
2002-02-03 13:40 ` Stephen Lord
2002-02-03 14:09 ` Chris Wedgwood
2002-02-03 15:05 ` Stephen Lord
2002-02-03 22:44 ` Chris Wedgwood
2002-02-04 15:04 ` Jeff Garzik
2002-02-04 15:21 ` Chris Mason
2002-02-04 15:15 ` Steve Lord
2002-02-04 15:46 ` Alan Cox
2002-02-04 16:02 ` Steve Lord
2002-02-04 18:22 ` Daniel Phillips
2002-02-04 19:11 ` Steve Lord
2002-02-04 18:29 ` Joel Becker [this message]
2002-02-04 18:49 ` Jeff Garzik
2002-02-04 18:55 ` Joel Becker
2002-02-04 19:16 ` Jeff Garzik
[not found] <E16WkQj-0005By-00@antoli.uib.es.suse.lists.linux.kernel>
[not found] ` <3C5AFE2D.95A3C02E@zip.com.au.suse.lists.linux.kernel>
[not found] ` <1012597538.26363.443.camel@jen.americas.sgi.com.suse.lists.linux.kernel>
[not found] ` <20020202093554.GA7207@tapu.f00f.org.suse.lists.linux.kernel>
[not found] ` <234710000.1012674008@tiny.suse.lists.linux.kernel>
[not found] ` <20020202205438.D3807@athlon.random.suse.lists.linux.kernel>
[not found] ` <242700000.1012680610@tiny.suse.lists.linux.kernel>
[not found] ` <3C5C4929.5080403@sgi.com.suse.lists.linux.kernel>
[not found] ` <20020202155028.B26147@havoc.gtf.org.suse.lists.linux.kernel>
2002-02-03 7:26 ` Andi Kleen
2002-02-04 15:13 ` Jeff Garzik
2002-02-04 15:31 ` Chris Mason
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=20020204182942.C2092@parcelfarce.linux.theplanet.co.uk \
--to=jlbec@evilplan.org \
--cc=akpm@zip.com.au \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=andrea@suse.de \
--cc=cw@f00f.org \
--cc=gallir@uib.es \
--cc=garzik@havoc.gtf.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lord@sgi.com \
--cc=mason@suse.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
all inboxes | Powered by JetHome®