Write-Behind (was Re: Record-access libraries)

Henry Spencer henry at utzoo.uucp
Fri Oct 28 03:27:05 AEST 1988


In article <74266 at sun.uucp> pope at vatican (John Pope) writes:
>... I've seen at least one
>implementation of disksort() in the operating system that optimized
>reads ahead of writes on the theory that processes don't wait for
>writes.  Such algorithms may also have made their way on board a disk
>controller or two...

I hope not, since they are known to exhibit pathological behavior under
stress.  If your system is disk-limited, as many are, it can generate
disk i/o requests faster than the controller can service them.  Most of
those requests are reads.  The result is that writes can wait a very
long time.  Worse, they occupy buffers while waiting, meaning that your
buffer pool slowly fills up with pending writes, and the effectiveness
of buffer caching drops dramatically.

And the amusing part is that this all results from a bug!  The read-
before-write algorithm was in V7.  But it wasn't supposed to be:  the
code was supposed to put writes before reads!  (I asked Dennis.)  The
"reads are synchronous, writes are not" explanation appears to have been
invented after the fact by someone trying to figure out the motive for
the (incorrect!) code.
-- 
The dream *IS* alive...         |    Henry Spencer at U of Toronto Zoology
but not at NASA.                |uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.unix.wizards mailing list