Block or Buffer caches are used to
2011
Block or Buffer caches are used to
Answer: A. improve disk performance — Concept: A block cache — also called the buffer cache — is a region of main memory that the operating system reserves to hold copies of the disk blocks it has…
- A.
improve disk performance
- B.
handle interrupts
- C.
increase the capacity of main memory
- D.
speed up main memory read operations
Attempted by 33 students.
Show answer & explanation
Correct answer: A
Concept: A block cache — also called the buffer cache — is a region of main memory that the operating system reserves to hold copies of the disk blocks it has recently read or written. A main-memory access is several orders of magnitude faster than a mechanical disk access, and file references show strong temporal locality, so a block that is already resident in that region can satisfy a later request for the same block without any transfer to or from the drive. Writes can likewise be absorbed by the region and flushed to the drive later, so several logical writes collapse into fewer physical ones.
Application: Trace what happens when a process reads the same disk block more than once.
A process issues a read for disk block B; the kernel first looks for B in the block cache.
On the first request B is not resident, so one physical transfer fetches it from the drive and a copy of B is retained in main memory.
The next request for B finds that copy already in memory, so it is served at memory speed and no request reaches the drive at all.
Across n requests for the same block the physical transfers fall from n to 1, and the time the workload spends waiting on the drive falls with them.
Cross-check: Contrast the mechanism above with the three neighbouring ideas the wording could be confused with.
Handling interrupts: a device interrupt is dispatched through the interrupt vector to a service routine in the kernel, using the interrupt controller and the saved process context — a data-block cache plays no part in that dispatch.
Increasing main-memory capacity: the block cache spends main memory rather than adding any; the mechanism that lets a process address more space than the installed RAM is demand paging against a swap area on secondary storage.
Speeding up main-memory read operations: the latency of a RAM read as seen by the processor is shortened by the CPU L1/L2/L3 cache hierarchy, which sits between the processor and memory; the block cache sits one level lower, between memory and the disk.
Result: Because the block or buffer cache removes physical disk accesses from the request path, it is used to improve disk performance.
Explore the full course: Mppsc Assistant Professor Computer Science Paper 2