Re: VFS?VM - mmap/write deadlock

Alexander Viro (viro@math.psu.edu)
Tue, 21 Dec 1999 14:21:53 -0500 (EST)


On Tue, 21 Dec 1999, Linus Torvalds wrote:

>
>
> On Mon, 20 Dec 1999, Linus Torvalds wrote:
> >
> > Ok, I think that was the solution I remember, but it's obviously broken.
> > It leaves a window of non-updated page contents that can be read. Ho
> > humm.. Your suggestion may be the way to go.
>
> Actually, a less intrusive but fairly cheesy fix is to just do a simple
> read of the first and the last byte of the source before locking the
> destination page.
>
> That means that the source will be brought in (which we have to do
> anyway), and for the degenerate case of source == dest we just magically
> avoided the special case because of the "up-to-date overrides the need for
> lock on a read" rule.

Not enough. You'll have to wire the source - otherwise you are in for
interesting races. Yes, doing it on per-target-page basis is probably the
right thing, _but_ you may be in for very nasty situations with massive
writev() (think scatter-gather IO from a thousand of pages - each
contributing a couple of bytes).

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/