A Sampling Algorithm for Software Prefetching Using Memory Access Traces
Software prefetching,an important technology for improving data access performance,has received widespread attention and has been used in several applications.Software prefetching often necessitates memory access trace analysis combined with a sampling algorithm to filter memory access instructions with cache misses as prefetching targets.However,traditional burst sampling algorithms cannot distinguish between different types of trace information and are prone to missing instructions with fewer accesses.To address these issues,a new sampling algorithm for memory access traces is proposed based on single-pass clustering and stratified sampling.First,the features of the memory trace information are extracted.Subsequently,a single-pass clustering method is used to cluster the memory information according to the similarity of features.Finally,stratified sampling is performed based on clustering,and the sampling ratio is adjusted according to the cache miss rate,which effectively mitigates the sampling omission of smaller categories.The experimental results show that the proposed algorithm covers an average of 15.70%more cache misses in the selected eight test programs than the traditional burst sampling algorithm.Prefetching based on the proposed sampling algorithm reduces the number of cache misses by 20.76%and program runtime by 3.51%.