Re: [patch] aio: invalidate async directio writes

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Zach Brown
Date: Thursday, June 19, 2008 - 10:50 am

> I'm utterly ignorant of all thing [AD]IO, but doesn't deferring the

The case we care about making consistent are buffered reads which the
user politely only issues after O_DIRECT writes have completed.

If they issue buffered reads that race with O_DIRECT writes, well, they
get to see weird versions of the data.  Just like if they issue buffered
reads that race with buffered writes.

But we must make sure that reads issued after the O_DIRECT writes are
not satisfied by cached data which was populated during a nasty racing
read.  So we invalidate cached pages in the range of the write after the
O_DIRECT write is on disk but before we tell the user that the write has
completed.

This is made even worse by the observation that racing buffered reads
might be issued behind the user's back as part of read-ahead.  People
have hit this very issue in systems where they have a ring buffer in a
file, an O_DIRECT writer, and a buffered reader that reads the blocks
just after they're written.

- z
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch] aio: invalidate async directio writes, Jeff Moyer, (Wed Jun 18, 11:09 am)
Re: [patch] aio: invalidate async directio writes, Christoph Hellwig, (Wed Jun 18, 11:22 am)
Re: [patch] aio: invalidate async directio writes, Jeff Moyer, (Wed Jun 18, 12:45 pm)
Re: [patch] aio: invalidate async directio writes, Christoph Hellwig, (Wed Jun 18, 12:48 pm)
Re: [patch] aio: invalidate async directio writes, Peter Zijlstra, (Thu Jun 19, 12:51 am)
Re: [patch] aio: invalidate async directio writes, Jeff Moyer, (Thu Jun 19, 6:50 am)
Re: [patch] aio: invalidate async directio writes, Peter Zijlstra, (Thu Jun 19, 6:58 am)
Re: [patch] aio: invalidate async directio writes, Jeff Moyer, (Thu Jun 19, 7:05 am)
Re: [patch] aio: invalidate async directio writes, Zach Brown, (Thu Jun 19, 10:23 am)
Re: [patch] aio: invalidate async directio writes, Zach Brown, (Thu Jun 19, 10:50 am)