CS FundamentalsHardGATE CS
A device delivers data at 2 MB/s. Per-byte interrupts would cost 5 µs each; instead DMA moves 4 KB blocks and raises one interrupt per block costing 20 µs. What fraction of CPU time do the interrupts take in each case?
- A. Per-byte: impossible, it would need 10 CPU-seconds per second; DMA: about 1%
- B. Per-byte: about 10%; DMA: about 0.01%
- C. Per-byte: 100%; DMA: about 1%
- D. Per-byte: impossible; DMA: about 0.24%
Correct answer: A. Per-byte: impossible, it would need 10 CPU-seconds per second; DMA: about 1%
Per byte: 2 × 10⁶ × 5 µs = 10 s of work per second, so it cannot keep up. DMA: 2 × 10⁶ / 4096 ≈ 488 interrupts/s × 20 µs ≈ 9.8 ms per second ≈ 1%. 0.24% uses 5 µs per DMA interrupt.
More Operating Systems questions
- A TLB has 64 entries. A program randomly touches a 100 MB data set. What is the TLB reach with 4 KB pages and with 2 MB huge pages, and…
- A spin lock is built from an atomic test-and-set: while (TestAndSet(&lock)) ; / critical section / lock = false;. Which property does it…
- Processes (arrival, burst): P1 (0, 8), P2 (1, 4), P3 (2, 9), P4 (3, 5), P5 (6, 2). Under SRTF (preemptive SJF; a running process keeps the…
- Round Robin with quantum 3; processes (arrival, burst): A (0, 7), B (2, 4), C (4, 6), D (5, 3). A process arriving at the same moment…
- Preemptive priority scheduling (smaller number = higher priority; a running process is not preempted by an equal priority). Processes…
- Non-preemptive SJF; processes (arrival, burst): P1 (0, 3), P2 (5, 6), P3 (6, 2), P4 (7, 1), P5 (8, 4). The CPU idles when nothing is…