Runtime Engine for Dynamic Profile Guided Stride Prefetching
- 30 Downloads
Stride prefetching is recognized as an important technique to improve memory access performance. The prior work usually profiles and/or analyzes the program behavior offline, and uses the identified stride patterns to guide the compilation process by injecting the prefetch instructions at appropriate places. There are some researches trying to enable stride prefetching in runtime systems with online profiling, but they either cannot discover cross-procedural prefetch opportunity, or require special supports in hardware or garbage collection. In this paper, we present a prefetch engine for JVM (Java Virtual Machine). It firstly identifies the candidate load operations during just-in-time (JIT) compilation, and then instruments the compiled code to profile the addresses of those loads. The runtime profile is collected in a trace buffer, which triggers a prefetch controller upon a protection fault. The prefetch controller analyzes the trace to discover any stride patterns, then modifies the compiled code to inject the prefetch instructions in place of the instrumentations. One of the major advantages of this engine is that, it can detect striding loads in any virtual code places for both regular and irregular code, not being limited with plain loop or procedure scopes. Actually we found the cross-procedural patterns take about 30% of all the prefetchings in the representative Java benchmarks. Another major advantage of the engine is that it has runtime overhead much smaller (the maximal is less than 4.0%) than the benefits it brings. Our evaluation with Apache Harmony JVM shows that the engine can achieve an average 6.2% speed-up with SPECJVM98 and DaCapo on Intel Pentium 4 platform, in spite of the runtime overhead.
Keywordsstride prefetching dynamic profiling runtime system
Unable to display preview. Download preview PDF.
- Robert Muth, Harish Patil, Richard Weiss, P Geoffrey Lowney, Robert Cohn. Profile-guided post-link stride prefetching. In Proc. 16th Int. Supercomputing, New York, USA, June 22–26, 2002, pp.167–178.Google Scholar
- Brendon D Cahoon. Effective compile-time analysis for data prefetching in Java [Dissertation]. University of Massachusetts, Amherst, 2002.Google Scholar
- Inagaki T, Onodera T, Komatsu H, Nakatani T. Stride prefetching by dynamically inspecting objects. In Proc. the ACM SIGPLAN 2003 Conference on Programming Language Design and Implementation, San Diego, California, USA, June 9–11, 2003, pp.269–277.Google Scholar
- Adl-Tabatabai A, Hudson R L, Serrano M J, Subramoney S. Prefetch injection based on hardware monitoring and object metadata. In Proc. the ACM SIGPLAN 2004 Conference on Programming Language Design and Implementation, Washington DC, USA, June 9–11, 2004, pp.267–276.Google Scholar
- Bernstein D, Cohen D, Freund A. Compiler techniques for data prefetching on the PowerPC. In Proc. the IFIP Wg10.3 Working Conference on Parallel Architectures and Compilation Techniques, Limassol, Cyprus, June 27–29, 1995, pp.19–26.Google Scholar
- Santhanam V, Gornish E H, Hsu W. Data prefetching on the HP PA-8000. In Proc. the 24th Annual International Symposium on Computer Architecture, Denver, Colorado, United States, June 1–4, 1997, pp.264–273.Google Scholar
- Suganuma T, Yasue T, Kawahito M, Komatsu H, Nakatani T. A dynamic optimization framework for a Java just-in-time compiler. In Proc. the 16th ACM SIGPLAN Conference on Object Oriented Programming, Systems, Languages, and Applications, Tampa Bay, FL, USA, October 14–18, 2001, pp.180–195.Google Scholar
- Arnold M, Ryder B G. A framework for reducing the cost of instrumented code. In Proc. the ACM SIGPLAN 2001 Conference on Programming Language Design and Implementation, Snowbird, Utah, United States, New York, pp.168–179.Google Scholar
- Apache Harmony project. http://harmony.apache.org/.
- Standand Performance Evaluation Corporation (SPEC). JVM client98 (SPECjvm98).Google Scholar
- The DaCapo benchmark suite. http://dacapobench.org/.
- Intel Corporation. Intel(R) architecture software developer’s manual, Volume 2: Instruction set reference manual. http://download.intel.com/design/intarch/manuals.
- Shuf Y, Serrano M J, Gupta M, Singh J P. Characterizing the memory behavior of Java workloads: A structured view and opportunities for optimizations. SIGMETRICS Perform. Eval. Rev., June 2001, pp.194–205.Google Scholar
- Hosking A L, Moss J E, Stefanovic D. A comparative performance evaluation of write barrier implementation. In Proc. Object-Oriented Programming Systems, Languages, and Applications, Vancouver, British Columbia, Canada, October 18–22, 1992, pp.92–109.Google Scholar
- Intel Corporation. VTune performance analyzer. http://www.intel.com/cd/software/products/apac/zho/vtune/275878.htm.
- Chen W, Bhansali S, Chilimbi T, Gao X, Chuang W. Profile-guided proactive garbage collection for locality optimization. SIGPLAN Not., Jun. 2006, pp.332–340.Google Scholar
- Chilimbi T M, Davidson B, Larus J R. Cache-conscious structure definition. In Proc. the ACM SIGPLAN 1999 Conference on Programming Language Design and Implementation, Atlanta, Georgia, United States, May 1–4, 1999, pp.13–24.Google Scholar