CS FundamentalsVery hardGATE CS (PYQ pattern)
A data TLB has 64 entries organised as 16 sets of 4 ways (set index = virtual page number mod 16, LRU within a set). A loop touches virtual pages 0, 16, 32, 48, 64, 1, 17, 33 in that order, 6 times (48 references), starting with an empty TLB. How many TLB misses occur?
- A. 8
- B. 48
- C. 36
- D. 33
Correct answer: D. 33
Pages 0, 16, 32, 48 and 64 all map to set 0, so a cyclic walk over 5 pages with 4 ways under LRU misses every time (30 misses); pages 1, 17, 33 share set 1 (3 pages fit in 4 ways): 3 cold misses. Total 33. A fully associative 64-entry TLB would miss only 8 times.
More Operating Systems questions
- The enhanced clock algorithm uses (R, M) bits with 3 frames (initially empty, newly loaded pages get R = 1 and M = 1 if loaded by a…
- Page-fault-frequency control with threshold T = 3: on a fault at time t, if more than 3 time units passed since the previous fault, all…
- A disk head is at cylinder 50 at t = 0, moving towards higher cylinders, and needs 1 time unit per cylinder (service itself is…
- Round Robin with quantum 3 ms, three processes arriving at t = 0 with bursts (CPU, I/O, CPU) in ms: P0 (5, 4, 4), P1 (3, 6, 3), P2 (6, 2…
- Process P0 has 4 pages, each in its own frame. Copy-on-write fork is used (a frame is copied only when written while shared; a written…
- Shared x = y = 0. Thread 1: x = 1; y = 1. Thread 2: r1 = y; r2 = x. Thread 3: x = 2; r3 = x. Under sequential consistency, how many…