Automated locality optimization based on the reuse distance of string operations
Authors:
- Silvius RusSRSilvius Rus
- Raksit AshokRARaksit Ashok
- David Xinliang LiDLDavid Xinliang Li
- 1 April 2011
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 181-190
Abstract
String operations such as memcpy, memset and memcmp account for a nontrivial amount of Google datacenter resources. String operations hurt processor cache efficiency when the data accessed is not reused shortly thereafter. Such cache pollution can be avoided by using nontemporal memory access to bypass L2/L3 caches. As reuse distance varies greatly across different memcpy static call contexts in the same program, an efficient solution needs to be call context sensitive. We propose a novel solution to this problem using the page protection mechanism to measure reuse distance and the GCC feedback directed optimization mechanism to generate nontemporal memory access instructions at the appropriate static code contexts. First, the compiler inserts instrumentation for calls to string operations. Then a run time library measures reuse distance using the page protection mechanism during a representative profiling run. The compiler finally generates calls to specialized string operations that use nontemporal operations for the arguments with large reuse distance. We present a full implementation and initial results including speedup on large datacenter applications.Keywords
This publication has 11 references indexed in Scilit:
- Static reuse distances for locality-based optimizations in MATLAB2010
- Program locality analysis using reuse distanceACM Transactions on Programming Languages and Systems, 2009
- Instruction-based reuse-distance prediction for effective cache management2009
- A component model of spatial locality2009
- Locality approximation using time2007
- Feedback-directed memory disambiguation through store distance analysis2006
- Generating cache hints for improved program efficiencyJournal of Systems Architecture, 2005
- A modified approach to data cache management1995
- Unified management of registers and cache using liveness and cache bypassACM SIGPLAN Notices, 1989
- Evaluation techniques for storage hierarchiesIBM Systems Journal, 1970