
6.6 Power Management and Optimization for Processes 333
Each process uses half the cache, so only two processes can be in the cache at the same
time.
Appearing below is a first schedule that uses a least-recently-used cache replacement
policy on a process-by-process basis.
P1
P1 P1, P2 P2, P3 P1, P3 P2, P1 P3, P2Cache
P2
P3
In the first iteration, we must fill up the cache, but even in subsequent iterations, compe-
tition among all three processes ensures that a process is never in the cache when it starts to
execute. As a result, we must always use the worst-case execution time.
Another schedule in which we have reserved half the cache for P1 is shown below ...