Re: elevator algorithm bug in ll_rw_blk.c

Rafael Reilova (rreilova@ececs.uc.edu)
Thu, 12 Nov 1998 22:56:13 -0500 (EST)


On Fri, 13 Nov 1998, Chris Wedgwood wrote:

> On Mon, Nov 09, 1998 at 11:37:43PM +0000, Stephen C. Tweedie wrote:
>
> > <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!
>
> How long has it not been broken for?
>
> I ask this because back aroun 2.1.26 I made a small char device which
> allowed to to log and then dump the sequences of disk update produced
> during a `sync' operation.
>
> Anyhow, the net result of this was that they were not optimally
> order, not even close.

Optimal order is not possible unless you know the future ;-)

The request *should* be optimally ordered within the current request queue
state. I.e. if the queue has request for the blocks [4, 10000, 10005] and
the 'elevator' is going 'up', you issue 4, then 10000. If you then get a
new request for block 5, your're out of luck. This is the classical
elevator alg. from OS course, I assume that's what Linux uses.

Cheers,

Rafael

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