Theoretical and practical aspects of virtual page placement for direct-mapped caches

Careful page placement is used to reduce the conflict miss rates for direct-mapped caches. We present several theoretical careful placement policies for obtaining and estimating upper bounds on direct-mapped cache performance. Perfect page placement is a method for generating a virtual page placement schedule that minimizes the cache conflict miss rate. This policy requires future knowledge of the workload to be processed and is proved NP-hard. Since perfect page placement is intractable for all but trivially small cache modeling studies, heuristics for approximating lower bounds on the conflict miss rate are presented. Lookahead page placement uses future knowledge of the cache access patterns of a workload. Lookahead policies map virtual pages to cache bins having favorable future usage characteristics and thereby minimize the conflict miss rate over the near term. Stochastic page placement policies use stochastic optimization algorithms to evolve page placement schedules that represent local minima of the perfect page placement solution space. Stochastic placement policies based on genetic algorithms and simulated annealing are presented. These theoretical policies are compared against several practical page placement policies using trace-driven simulations of emulated, multi-user UNIX workloads. The implementation and performance of practical careful placement policies is also studied. Impure careful placement occurs when there are insufficient free frames to place pages according to policy. Simulation results indicate that impure placement causes higher cache conflict miss rates than pure placement for some workloads. Colored page stealing uses page replacement strategies that are designed to reduce the careful placement miss rate. System measurement experiments of careful placement and colored stealing algorithms implemented on a Data General DG/UX system demonstrate that colored page stealing can practically eliminate impure placement but can increase paging by ten percent or more for some workloads. Colored stealing for other workloads reduces the placement miss rates significantly with no additional cost in paging.