Operating systems — caching: What is the principal purpose of block or buffer caches in a general-purpose operating system?

Difficulty: Easy

Correct Answer: to improve disk performance

Explanation:


Introduction / Context:
Buffer caches (also called page cache or block cache) are core OS components that keep recently accessed disk blocks in RAM. They bridge the performance gap between slow storage devices and much faster main memory and CPU.



Given Data / Assumptions:

  • Disks have higher latency and lower throughput than RAM.
  • Temporal and spatial locality means data is often reused shortly after it is read.
  • The OS manages a cache of blocks/pages to exploit locality.


Concept / Approach:

By caching frequently accessed blocks, the OS serves subsequent reads from RAM and coalesces or defers writes (write-back/write-through policies). This reduces average access time and alleviates contention on storage devices, improving system responsiveness and throughput.



Step-by-Step Solution:

Recognize that caches store recent disk blocks in memory.Understand that cache hits avoid expensive disk I/O.Conclude that the main goal is to improve disk performance perceived by applications.


Verification / Alternative check:

System monitoring (e.g., cache hit ratios) demonstrates reduced I/O operations and improved performance when caches are effective.



Why Other Options Are Wrong:

  • Handle interrupts: Managed by the interrupt subsystem, not the buffer cache.
  • Increase capacity of main memory: Caches use existing memory; they do not increase capacity.
  • Speed up main memory reads: RAM access is already fast; caches target slow disk I/O.
  • None of the above: Incorrect because improving disk performance is precise.


Common Pitfalls:

Confusing buffer cache with virtual memory paging; ignoring write policies and data consistency issues.



Final Answer:

to improve disk performance

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion