Re: elevator algorithm bug in ll_rw_blk.c

Stephen C. Tweedie (sct@redhat.com)
Mon, 9 Nov 1998 23:37:43 GMT


Hi,

On Sun, 8 Nov 1998 17:15:01 +0100 (MET), Wolfgang Oertl
<Wolfgang.Oertl@uibk.ac.at> said:

> as v2.2 is expected soon I better bring this topic up now. As you
> know the "elevator algorihm" is employed for disk I/O, but -- it
> *looks* broken to me.

It isn't!

> What's actually being done is to always serve the block with the
> lowest number. This starves high block numbers. See
> drivers/block/ll_rw_blk.c, line ~333, search for IN_ORDER.

No. The queue is always kept sorted, yes, but as soon as an IO starts,
the current request is not removed from the queue until IO is complete
(except for SCSI, which does its own queue ordering). Once that single
IO request is complete, the driver then moves on to the *next* request
in the queue. It doesn't start again at the beginning. So, we do
correctly service the higher numbered requests before going back to the
low ones.

--Stephen

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