skip to main content
10.1145/1806651.1806670acmconferencesArticle/Chapter ViewAbstractPublication PagesismmConference Proceedingsconference-collections
research-article

A graph theoretic approach to cache-conscious placement of data for direct mapped caches

Published:05 June 2010Publication History

ABSTRACT

Caches were designed to amortize the cost of memory accesses by moving copies of frequently accessed data closer to the processor. Over the years the increasing gap between processor speed and memory access latency has made the cache a bottleneck for program performance. Enhancing cache performance has been instrumental in speeding up programs. For this reason several hardware and software techniques have been proposed by researchers to optimize the cache for minimizing the number of misses. Among these are compile-time data placement techniques in memory which improve cache performance. For the purpose of this work, we concern ourselves with the problem of laying out data in memory given the sequence of accesses on a finite set of data objects such that cache-misses are minimized. The problem has been shown to be hard to solve optimally even if the sequence of data accesses is known at compile time. In this paper we show that given a direct-mapped cache, its size, and the data access sequence, it is possible to identify the instances where there are no conflict misses. We describe an algorithm that can assign the data to cache for minimal number of misses if there exists a way in which conflict misses can be avoided altogether. We also describe the implementation of a heuristic for assigning data to cache for instances where the size of the cache forces conflict misses. Experiments show that our technique results in a 30% reduction in the number of cache misses compared to the original assignment.

References

  1. A. Aggarwal. Software Caching vs. Prefetching. In ISMM '02: Proceedings of the 3rd International Symposium on Memory Management, pages 157--162, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. A. H. Badawy, A. Aggarwal, D. Yeung, and C. Tseng. Evaluating the Impact of Memory System Performance on Software Prefetching and Locality Optimizations. In ICS '01: Proceedings of the 15th International Conference on Supercomputing, pages 486--500, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. R. E. Bixby, K. Kennedy, and U. Kremer. Automatic Data Layout Using 0-1 Integer Programming. In PACT '94: Proceedings of the IFIP WG10.3Working Conference on Parallel Architectures and Compilation Techniques, pages 111--122, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. B. Calder, C. Krintz, S. John, and T. Austin. Cache-Conscious Data Placement. In ASPLOS VIII: Proceedings of the 8th International Conference on Architectural Support for Programming Languages and Operating Systems, pages 139--149, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. D. Callahan, K. Kennedy, and A. Porterfield. Software Prefetching. In ASPLOS IV: Proceedings of the Fourth International Conference on Architectural Support for Programming Languages and Operating Systems, pages 40--52, April 08-11, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. T. M. Chilimbi. Efficient Representations and Abstractions for Quantifying and Exploiting Data Reference Locality. In PLDI '01: Proceedings of the ACM SIGPLAN 2001 Conference on Programming Language Design and Implementation, pages 191--202, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. T. M. Chilimbi, B. Davidson, and J. R. Larus. Cache-Conscious Structure Definition. In PLDI '99: Proceedings of the ACM SIGPLAN Conference on Programming Languages Design and Implementation, 1--12, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. T. M. Chilimbi, M. D. Hill, and J. R. Larus. Cache-Conscious Structure Layout. In PLDI '99: Proceedings of the ACM SIGPLAN Conference on Programming Languages Design and Implementation, 1--12, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. T. M. Chilimbi, and M. Hirzel. Dynamic Hot Data Stream Prefetching for General-Purpose Programs. In PLDI '02: Proceedings of the ACM SIGPLAN 2002 Conference on Programming language design and implementation, June 17-19, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. T. M. Chilimbi, and J. R. Larus. Using Generational Garbage Collection to Implement Cache-Conscious Data Placement. In ISMM '98: Proceedings of the 1st International Symposium on Memory Management, 37--48, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. S. Curial, P. Zhao, J. N. Amaral, Y. Gao, S. Cui, R. Silvera, and R. Archambault. Memory Pooling Assisted Data Splitting (MPADS). Proceedings of the 7th International Symposium on Memory Management, June 07-08, pages 101--110, 2008, Tucson, AZ, USA Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. C. Ding, and K. Kennedy. Improving Cache Performance in Dynamic Applications through Data and Computation Reorganization at Run Time. In PLDI '99: Proceedings of the ACM SIGPLAN 1999 Conference on Programming Language Design and Implementation, pages 229--241, May 01-04, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. C. Ding, and Y. Zhong. Predicting Whole-Program Locality through Reuse Distance Analysis. In PLDI '03: Proceedings of the ACM SIGPLAN 2003 Conference on Programming Language Design and Implementation, pages 245--257, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. M. C. Golumbic. Algorithmic Graph Theory and Perfect Graphs (Annals of Discrete Mathematics, Vol 57). North-Holland Publishing Co., Amsterdam, The Netherlands, The Netherlands, 2004 Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. X. Gu, I. Christopher, T. Bai, C. Zhang, and C. Ding. A Component Model of Spatial Locality. Proceedings of the 2009 International Symposium on Memory Management, June 19-20, 2009, Dublin, Ireland Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. J. L. Hennessy, D. A. Patterson, and A. C. Arpaci-Dusseau. Computer Architecture: A Quantitative Approach. Fourth Edition, 2007. Morgan Kaufman Publishers. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. G. Jin, J. Mellor-Crummey, and R. Fowler. Increasing Temporal Locality with Skewing and Recursive Blocking. Proceedings of the 2001 ACM/IEEE conference on Supercomputing, pages 43--43, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. A. Jula, and L. Rauchwerger. Two Memory Allocators that use Hints to Improve Locality. In ISMM '09: Proceedings of the 2009 International Symposium on Memory Management, June 19-20, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. C. Lattner, and V. Adve. Automatic Pool Allocation: Improving Performance by Controlling Data Structure Layout in the Heap. In PLDI '05: Proceedings of the 2005 ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 129--142, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. E. Petrank, and D. Rawitz. The Hardness of Cache Conscious Data Placement. In POPL '02: Proceedings of the 29th ACM SIGPLANSIGACT symposium on Principles of Programming Languages, pages 101--112, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. E. Petrank, and D. Rawitz. The Hardness of Cache Conscious Data Placement. Nordic Journal of Computing, vol 12(3), pages 275--307, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. G. B. Prokopski, and C. Verbrugge. Analyzing the Performance of Code-Copying Virtual Machines. In OOPSLA '08: Proceedings of the 23rd ACM SIGPLAN Conference on Object-Oriented Programming Systems Languages and Applications, pages 403--422, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. X. Shen, J. Shaw, B. Meeker, and C. Ding. Locality Approximation Using Time. In POPL '07: Proceedings of the 34th annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 55--61, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. K. O.Thabit. Cache Management by the Compiler. Ph.D. thesis, Rice University, 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. M. E. Wolf, D. E. Maydan, and D. Chen. Combining Loop Transformations Considering Caches and Scheduling. In the International Journal of Parallel Programming, vol 26(4), pages 479--503 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. C. Zhang, C. Ding, M. Ogihara, Y. Zhong, and Y. Wu. A Hierarchical Model of Data Locality. In POPL '06: Conference of the 33rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 16--29, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Y. Zhong, amd W. Chang. Sampling-based Program Locality Approximation. Proceedings of the 7th International Symposium on Memory Management, June 07-08, 2008, Tucson, AZ, USA Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Y. Zhong, X. Shen, and C. Ding. Program Locality Analysis using Reuse Distance. ACM Transactions on Programming Languages and Systems (TOPLAS), v.31 n.6, p.1--39, August 2009 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A graph theoretic approach to cache-conscious placement of data for direct mapped caches

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in
  • Published in

    cover image ACM Conferences
    ISMM '10: Proceedings of the 2010 international symposium on Memory management
    June 2010
    140 pages
    ISBN:9781450300544
    DOI:10.1145/1806651
    • General Chair:
    • Jan Vitek,
    • Program Chair:
    • Doug Lea
    • cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 45, Issue 8
      ISMM '10
      August 2010
      129 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/1837855
      Issue’s Table of Contents

    Copyright © 2010 ACM

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 5 June 2010

    Permissions

    Request permissions about this article.

    Request Permissions

    Check for updates

    Qualifiers

    • research-article

    Acceptance Rates

    Overall Acceptance Rate72of156submissions,46%

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader
About Cookies On This Site

We use cookies to ensure that we give you the best experience on our website.

Learn more

Got it!