Re: Non-blocking read

Nitin Sonawane (nsonawane@infolibria.com)
Mon, 14 Jun 1999 19:28:04 -0400


Arjan van de Ven wrote:
>
> On Tue, 15 Jun 1999, Chris Wedgwood wrote:
>
> > On Mon, Jun 14, 1999 at 11:27:09AM -0700, David S. Miller wrote:
> >
> > > By looking at the code (2.3.6), there seems to be no possibility
> > > to do this. Am I wrong or is it not worth the effort (I might
> > > disagree) or just impossible?
> > >
> > > You probably want "filp->f_flags |= O_NONBLOCK"
> >
> > How does this help? Last time I checked, there is _no_ way of doing
> > non-blocking disk IO in the kernel.
> >
>
> Yes there is. It is called "asynchronous readahead".

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.

AFAIK, the only way to guarantee non-blocking reads is by leaving
another context inside the kernel either by means of kernel threads or
another process whose sole job is to handle these reads while allowing
the other process to do other things.

Cheers,
Nitin.

>
> Greetings,
> Arjan van de Ven
>

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