Ninety Millisecond Tail

A storage service allocates pages on the request path. The allocator is purely reactive:

frame = find_free_frame();
if (frame == NULL) {
    victim = pick_victim();
    if (victim.dirty) disk_write(victim);   // synchronous
    frame = reclaim(victim);
}
disk_read(needed_page, frame);

Under load, p50 request latency stays at 3 ms but p99 jumps to 90 ms. Adding a background daemon that keeps the free-frame count between a low watermark and a high watermark drops p99 back to 5 ms, with p50 unchanged. Which explanation fits the measurements?

A

Without the daemon the allocator spends its time scanning the replacement policy's data structures, which is CPU-bound. The real fix is a cheaper victim-selection policy.

B

The one unlucky request that found zero free frames paid a synchronous write-back plus the read it actually needed. The daemon moves the write-back off the request path and can batch several evictions into one clustered disk write.

C

The daemon reduces total disk I/O, so the device queue drains faster and every request gets quicker.

D

The daemon keeps hot pages resident, cutting the page fault rate, so fewer requests need any disk access at all.