From: Jens Axboe <axboe@suse.de>
To: Bryan Henderson <hbryan@us.ibm.com>
Cc: Jamie Lokier <jamie@shareable.org>,
linux-fsdevel@vger.kernel.org,
Werner Almesberger <wa@almesberger.net>
Subject: Re: barriers vs. reads
Date: Wed, 23 Jun 2004 18:52:22 +0200 [thread overview]
Message-ID: <20040623165221.GO1120@suse.de> (raw)
In-Reply-To: <OFBA617765.DF98BFF4-ON88256EBC.005A1B86-88256EBC.005B9C96@us.ibm.com>
On Wed, Jun 23 2004, Bryan Henderson wrote:
> >> Are you saying that if Sector A contains "foo", and I do a
> >> __make_request(Write, Sector A, "bar") and then a __make_request(Read,
> >> Sector A), the read might read "foo"? Assuming no barriers.
> >
> >Well no, even for direct io we maintain ordering if you hit an alias.
> >...
> >If you have overlapping requests, then you could get into serious
> >trouble. You should not do that.
>
> What is an alias, and how is it different from an overlap?
It's just an internal problem - when you add a request to the rbtree of
the io scheduler, and an existing request with that key (start location)
already exists.
> Also: The question is about the block layer, but you answer in terms
> of direct I/O. Does __make_request() know what direct I/O is? I
> thought it just did I/O for I/O's sake.
The block layer doesn't know and it doesn't care. I answer in terms of
direct IO since that's the only way you'll get a request issued for the
same sector. As mentioned below, the page cache prevents that from
happening.
> >The page cache will make sure don't see "foo", since you'll wait for the
> >page to unlocked at the end of io.
>
> If it's a page cache page, the point is moot because the elevator would
> never see the sequence of requests in question. But my question is about
Precisely.
> the general case, with no assumptions about who is calling
> __make_request() and why.
As stated earlier in this thread, the io scheduler makes no real attempt
to cope with this scenario. Users of direct io are expected to
syncronize themselves. It would be pretty silly not to do this, if only
for performance reasons. The fact that the io scheduler catches
"aliases" is not a feature and not something that is really useful in
this respect, since it's only a slight subset of the general problem of
overlapping ios.
--
Jens Axboe
next prev parent reply other threads:[~2004-06-23 16:52 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-22 3:53 barriers vs. reads Werner Almesberger
2004-06-22 7:39 ` Jens Axboe
2004-06-22 7:50 ` Werner Almesberger
2004-06-22 7:55 ` Jens Axboe
2004-06-22 8:34 ` Werner Almesberger
2004-06-22 10:08 ` Jens Axboe
2004-06-22 11:28 ` Jamie Lokier
2004-06-22 11:32 ` Jens Axboe
2004-06-22 17:12 ` Bryan Henderson
2004-06-22 20:53 ` Jens Axboe
2004-06-23 16:41 ` Bryan Henderson
2004-06-23 16:52 ` Jens Axboe [this message]
2004-06-23 16:53 ` Jamie Lokier
2004-06-23 21:08 ` Bryan Henderson
2004-06-23 23:23 ` Werner Almesberger
2004-06-24 13:43 ` Jamie Lokier
2004-06-24 14:32 ` Christoph Hellwig
2004-06-24 17:05 ` Werner Almesberger
2004-06-22 18:53 ` Werner Almesberger
2004-06-22 19:57 ` Jamie Lokier
2004-06-22 23:13 ` Werner Almesberger
2004-06-22 20:57 ` Jens Axboe
2004-06-22 23:10 ` Werner Almesberger
2004-06-23 0:14 ` Jamie Lokier
2004-06-23 6:27 ` Jens Axboe
2004-06-22 18:45 ` Werner Almesberger
2004-06-22 19:07 ` Guy
-- strict thread matches above, loose matches on Subject: below --
2004-06-24 0:48 Werner Almesberger
2004-06-24 3:39 ` Werner Almesberger
2004-06-24 8:00 ` Herbert Poetzl
2004-06-24 12:16 ` Werner Almesberger
2004-06-24 13:36 ` Jamie Lokier
2004-06-24 17:02 ` Werner Almesberger
2004-06-24 16:39 ` Steve Lord
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=20040623165221.GO1120@suse.de \
--to=axboe@suse.de \
--cc=hbryan@us.ibm.com \
--cc=jamie@shareable.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=wa@almesberger.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.