Block Cache (cont.)
Modified LRU that takes into account:
- Will we need these blocks again ?
- Maybe we closed the file.
- Free-behind - maybe it is a sequential operation.
- Is this block crucial for consistency (for example - it contains the inode) ?
- We might need to write it to disk immediately. We can still keep it in memory, of course.
- MS/DOS method - write through cache.
- Read-ahead - we can read, together with the requested block, the following blocks from the disk and cache them.
- It might be useful to sync the dirty blocks to disk from time to time.