Practice question · Multiple choice
A DMA controller writes data into memory while the CPU holds an older copy of that region in its cache. What problem does that create?
Hints
- The CPU thinks it already knows what is at that address. Ask who told it.
- DMA bypasses the CPU entirely. What does that mean for the cache's copy?
Show the answer
B. Cache incoherence, the CPU reads its stale cached copy
Why
DMA's whole point is bypassing the CPU, so the cache is never told the memory changed and happily serves stale bytes. Device drivers therefore invalidate cache ranges around transfers, an unglamorous detail, and a classic source of bugs that appear only under load when the line happens to still be resident.
Practise Input-Output and Peripheral Communication
The app has 5 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.
More questions on Input-Output and Peripheral Communication
- Order what happens when a device signals the CPU with an interrupt.
- Polling, interrupts and DMA all move data between a device and memory. Why does adding DMA improve throughput…
- Sort each peripheral by the direction in which data mainly flows.
- Match each mechanism or component to what it does.
- Select every statement that is a genuine advantage of interrupts over polling.