CS FundamentalsModerateGATE CS
Why is pure LRU rarely implemented exactly in hardware, and what is used instead?
- A. LRU suffers from Belady's anomaly
- B. Updating a timestamp or stack on every memory reference is too expensive; approximations using reference bits (clock, aging) are used
- C. LRU needs knowledge of future references
- D. LRU requires the dirty bit
Correct answer: B. Updating a timestamp or stack on every memory reference is too expensive; approximations using reference bits (clock, aging) are used
Exact LRU would need an update on each access. Reference bits sampled by the OS (second chance, aging counters) approximate recency cheaply. OPT is the algorithm needing the future.
More Operating Systems questions
- The aging algorithm keeps an 8-bit counter per page; every tick it shifts the counter right by one and puts the page's reference bit into…
- Which is a disadvantage of a very large page size (e.g. 1 GB pages for all memory)?
- Kernel same-page merging (KSM) / page deduplication scans for identical pages across VMs and maps them to one frame. What makes this safe…
- Writes of at most PIPEBUF bytes to a pipe have which guarantee when several writers share the pipe?
- A process reads a file sequentially, and the OS detects this. Which buffer-cache policy is most appropriate?
- Which statement about the unified buffer cache (page cache shared by mmap and read/write) is correct?