p5 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. .SH
  2. The read-ahead processes
  3. .PP
  4. There are a set of file system processes,
  5. .CW rah ,
  6. that wait for messages consisting of a device and block
  7. address.
  8. When a message comes in,
  9. the process reads the specified block from the device.
  10. This is done by calling
  11. .CW getbuf
  12. and
  13. .CW putbuf .
  14. The purpose of this is the hope that these blocks
  15. will be used later and that they will reside in the
  16. buffer cache long enough not to be discarded before
  17. they are used.
  18. .PP
  19. The messages to the read-ahead processes are
  20. generated by the server processes.
  21. The server processes maintain a relative block mark in every
  22. open file.
  23. Whenever an open file reads that relative block,
  24. the next 110 block addresses of the file are sent
  25. to the read-ahead processes and
  26. the relative block mark is advanced by 100.
  27. The initial relative block is set to 1.
  28. If the file is opened and
  29. only a few bytes are read,
  30. then no anticipating reads are performed
  31. since the relative block mark is set to 1
  32. and only block offset 0 is read.
  33. This is to prevent some
  34. fairly common action such as
  35. .P1
  36. file *
  37. .P2
  38. from swamping the file system with read-ahead
  39. requests that will never be used.