Re: Non-blocking read

Rogier Wolff (R.E.Wolff@BitWizard.nl)
Tue, 15 Jun 1999 15:09:43 +0200 (MEST)


Arjan van de Ven wrote:
> In article <37659004.6C72667F@infolibria.com> you wrote:
> > Async. read-ahead would not be reliable, would it? The next time you
> > (as in your process that wants this data block) context switches in, the
> > read-ahead data may have disappeared from the buffer cache. Theres also
> > this added complication of second level indirection coming from the
> > inode.

> When I (= the application) ask for a non-blocking read, I don't mind
> getting a -EAGAIN if the data is _not_ available right now. As long
> as it will be available sometime in the future, it is ok since I
> will ask again...

The problem that <whomever> wrote about is that if you do the "read"
now, the system can attempt to read the data, but there is no
guarantee that it will still be in the buffer cache if you ... finally
... get around to reading it.

We should "solve" this by issueing the "readahead request" once the
unsatisfied "read" happens, and then just count on the application to
be well behaved in that it will read the requested data within
reasonable time again....

Pretty safe assumption if we're doing this for performance reasons.

If the data drops out of the cache befor ethe application has a chance
to read it, then that's simply too bad, and the request (i.e. read
will have to be issued again.).

Regards,

Roger.

** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
------ Microsoft SELLS you Windows, Linux GIVES you the whole house ------

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