Re: Cached IO Synchronization Question

From: Nick Piggin
Date: Wed Apr 08 2009 - 23:56:46 EST


On Thursday 09 April 2009 01:56:38 Matt Klein wrote:
> >
> > Note how do_generic_file_read() checks PageUptodate() and does a
> > lock_page_killable() in case its not.
> >
> >
> >
>
> As far as I can tell there is nothing to prevent the page from becoming
> out of date (or someone doing a full page cached write) after the
> PageUptodate() check returns up to date.

Anything which marks the page not uptodate does not change the actual
page data, so the copy will still copy over valid data.

There is otherwise no synchronisation between reads and writes.

All we care about is that the data has been valid at some point in
time.


> So I have concluded that cached read/write interleaving is not
> synchronized. This is the behavior found on Windows.

Right.


--
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/