Suggestion: 3 levels of Buffer-Cache Operation

David C. Niemi (
Thu, 27 Jul 1995 21:11:21 -0400 (EDT)

I have been thinking about the buffer cache, and it occurred to me that
there are basically three types of devices which the kernel needs to be
able to tell apart:

1) "Slow" devices: network file systems, CD-ROMs, or floppies, which are
much slower than a hard disk and for which it is worth doing buffering
even if the device's buffer cache is swapped to disk.

2) "Normal" devices: devices like hard disks which are worth buffering in
exactly the way buffering currently works, i.e. in spare RAM only.

3) "Fast" or "memory" devices: RAM disks, maybe very fast RAID arrays, and
other very fast devices that may appear in the future, which are so fast
that it does not pay to buffer them in RAM. This could also be useful for
some removeable media or other cases where buffering may be undesirable.

As all of these categories are somewhat subjective, and it would be best
not to change the existing drivers much if at all; instead, it makes sense
to me to have an ioctl and a mount time option that uses it to let the
administrator specify which behavior is desired from the buffer cache.

I have seen requests for 1) and 3), but I never heard them mentioned in
the same breath. It seems to me that they are sides of the same coin, as
they both involve giving the kernel "hints" on how to treat a device.

Does this make any sense? Could this fit in with the new reorganization of
the buffer cache?

----David C., VA USA----
We have a long and rich history, but no future save what we dare to dream.