Dynamic instruction cache locking in hard real-time systems
Abstract
Cache memories have been widely used in order to bridge the gap between high speed processors and relatively slower main memories, and thus to improve the overall performance of systems. However in the context of hard real-time systems, they are a source of predictability problems. A lot of progress has been achieved to model caches to statically determine safe and precise bounds on the worst-case execution times (WCETs) estimates of tasks on architectures with caches. Nonetheless cache-aware WCET analysis techniques may not always be applicable or may be too pessimistic, because some memory accesses are unknown statically. Another reason may come from a poorly documented or non-deterministic cache line replacement policy. An alternative approach is to lock cache lines so as to make memory access times entirely predictable. In this paper, we consider an instruction cache and a task. We propose a an algorithm which partitions the task into a set of regions. Each region owns statically a locked cache contents determined offline. A set of tasks is used to experimentally analyze the effects of the algorithm on the worst-case cache miss rate (WCCMR). A sharp improvement is observed, as compared with a system without any cache. Furthermore it is observed that the results obtained on WCCMRs compare to the results obtained from static analysis of a cache whose policy is to replace least recently used (LRU) cache lines. Contrary to cache analysis techniques, our algorithm depends neither on the scheduling policy, nor on the cache line replacement policy. As a further property, it works at the machine language level, and thus does not require any source code.
References (13)
- J. V. Busquets-Mataix, J. J. Serrano, R. Ors, P. Gil, and A. Wellings. Adding instruction cache effect to schedulability analysis of pre- emptive real-time systems. In Proceedings of the 1996 Real-Time technology and Applica- tions Symposium (RTAS '96), pages 204-212. IEEE Computer Society, June 1996.
- A. Marti Campoy, A. P. Ivars, and J. V. Bus- quets Mataix. Static use of locking caches in multitask preemptive real-time systems. In Proceedings of the IEEE/IEE Real-Time Em- bedded Systems Workshop (RTES'01), 2001.
- A. Marti Campoy, A. P. Ivars, F. Rodriguez, and J. V. Busquets Mataix. Static use of lock- ing caches vs. dynamic use of locking caches for real-time systems. In IEEE Canadian Conference on Electrical and Computer En- gineering, Montreal, Canada, May 2003.
- A. Colin and I. Puaut. A modular retar- getable framework for tree-based wcet anal- ysis. In Proceedings of the 13th Euromicro Conference on Real-Time Systems, pages 37- 44, The Netherlands, June 2001.
- D. B. Kirk. Smart (strategic memory allo- cation for real-time) cache design. In Pro- ceedings of the 10th IEEE Real-Time Sys- tems Symposium (RTSS '89), pages 229-237, Santa Monica, CA, USA, December 1989.
- C. Lee, J. Hahn, Y. Seo, S. Min, R. Ha, S. Hong, C. Park, M. Lee, and C. S. Kim. Analysis of cache-related preemption delay in fixed-priority preemptive schedul- ing. IEEE Transactions on Computers, 47(6):700-713, June 1998.
- T. Lundqvist and P. Stenström. An integrated path and timing analysis method based on cycle-level symbolic execution. Real-Time Systems, 17(2-3):183-207, 1999.
- F. Mueller. Compiler support for software- based cache partitioning. In LCTES '95: Pro- ceedings of the ACM SIGPLAN 1995 work- shop on Languages, compilers, & tools for real-time systems, pages 125-133, New York, NY, USA, 1995. ACM Press.
- F. Mueller. Timing analysis for instruction caches. Real-time systems, 18(2):217-247, May 2000.
- I. Puaut, A. Arnaud, and D. Decotigny. Anal- yse de performance de méthodes de verrouil- lage statique de caches dans les systèmes temps-réel strict. In Proc. of the 12th Inter- national Conference on Real-Time Systems (RTS'04), March 2004.
- I. Puaut and D. Decotigny. Low-complexity algorithms for static cache locking in multi- tasking hard real-time systems. In Proceed- ings of the 23rd IEEE International Real- Time Systems Symposium (RTSS '02), Austin, TX, USA, December 2002.
- S. Steinke, N. Grunwald, L. Wehmeyer, R. Banakar, M. Balakrishnan, and P. Mar- wedel. Reducing energy consumption by dy- namic copying of instructions onto onchip memory. In ISSS '02: Proceedings of the 15th international symposium on System Syn- thesis, pages 213-218, New York, NY, USA, 2002. ACM Press.
- X.Vera, B. Lisper, and J.Xue. Data caches in multitasking hard real-time systems. In 24th IEEE International Real-Time Systems Sym- posium (RTSS '03), Cancun, Mexico, 2003. IEEE Computer Society Press.