Re: Asynch I/O broken in 2.2.15

From: Steve Dodd (steved@loth.demon.co.uk)
Date: Thu Apr 13 2000 - 02:20:42 EST


On Wed, Apr 12, 2000 at 05:50:47PM -0600, Jeff V. Merkey wrote:

> 1. Linux 2.2.15 and 2.3.99 do not support true Asynch IO.
[..]

That's not my interpretation, certainly:

- You ('one') set up a bunch of buffer_heads structures
- You submit them to ll_rw_block. For each bh, it passes it to the block
  dev driver or queues it, depending on the state of the device.
- You do the run_task_queue(tq_disk) thing to start I/O on any bhs that
  were queued by ll_rw_block (this presumably allows requests on the queue
  to be coalesced, reordered, etc.)
- The driver calls bh->b_end_io whenever it completes I/O on a bh.
- You do something else, or schedule(), etc., while you wait..

The b_end_io function can make use of b_wait to wake up a process when the
I/O completes. That seems pretty async to me. I'll admit that the
run_task_queue(tq_disk) chould perhaps be hidden behind a macro with a clearer
name.

> The way it's implemented in Linux requires that the bottom half ISR be
> "polled" within wait_on_buffer() or some other function to initiate the
> I/O and block until the IO returns -- how is this asynchronous I/O.

I don't think wait_on_buffer polls anything; it starts any pending I/O
and then sleeps; the b_end_io callback wakes it up when the I/O is finished.
The only thing I'm not clear on is the purpose of the do / while loop - under
what situations would it get woken up without the I/O having completed?

-- 
The very concept of PNP is a lovely dream that simply does not translate to
reality. The confusion of manually doing stuff is nothing compared to the
confusion of computers trying to do stuff and getting it wrong, which they
gleefully do with great enthusiasm. -- Jinx Tigr in the SDM

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



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:20 EST