Questions: I/O Buffering and Kernel Buffer Caches

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A process calls write() to save a file and the call returns successfully. Two seconds later, the system crashes unexpectedly. Will the data be on disk when the system restarts?

AYes — write() returning means the data was committed to disk
BNo — with write-back caching, write() only puts data in the kernel buffer cache; it is lost if the buffer was never flushed to disk
CYes — the kernel always flushes dirty buffers before returning from write()
DNo — write() never guarantees durability regardless of caching policy
Question 2 Multiple Choice

What does it mean for a kernel buffer to be 'dirty'?

AThe buffer contains data that has been corrupted or is no longer valid
BThe buffer holds data that has been written by a process but not yet flushed to the underlying storage device
CThe buffer was recently evicted and its data is now only on disk, not in memory
DThe buffer is currently being read from disk into the cache
Question 3 True / False

If a file's blocks are in the kernel buffer cache, a process's read() call for that file will not generate any disk I/O.

TTrue
FFalse
Question 4 True / False

Write-back caching provides stronger data durability guarantees than write-through caching because the kernel takes responsibility for managing the writes.

TTrue
FFalse
Question 5 Short Answer

Why do database systems typically call fsync() after committing a transaction, even though it significantly slows write throughput?

Think about your answer, then reveal below.