Abstract
Out-of-memory errors are a serious source of unreliability in most embedded systems. Applications run out of main memory because of the frequent difficulty of estimating the memory requirement before deployment, either because it depends on input data, or because certain language features prevent estimation. The typical lack of disks and virtual memory in embedded systems has a serious consequence when an out-of-memory error occurs. Without swap space, the system crashes if its memory footprint exceeds the available memory by even 1 byte. This work improves reliability for multitasking embedded systems by proposing MTSS, a multitask stack sharing technique. If a task attempts to overflow the bounds of its allocated stack space, MTSS grows its stack into the stack memory space allocated for other tasks. This technique can avoid the out-of-memory error if the extra space recovered is sufficient to complete execution. Experiments show that MTSS is able to recover an average of 54% of the stack space allocated to the overflowing task in the free space of other tasks. In addition, unlike conventional systems, MTSS detects memory overflows, allowing the possibility of remedial action or a graceful exit if the recovered space is not enough. Alternatively, MTSS can be used for decreasing the required physical memory of an embedded system by reducing the initial memory allocated to each of the tasks and recovering the deficit by sharing stack with other tasks. The overheads of MTSS are low: the runtime and energy overheads are 3.1% and 3.2%, on average. These are tolerable given that reliability is the most important concern in virtually all systems, ahead of other concerns, such as runtime and energy.
- Appel, A. W. 1987. Garbage collection can be faster than stack allocation. Inform. Process. Lett. 25, 4, 275--279. Google Scholar
Digital Library
- Appel, A. W. and Ginsburg, M. 1998. Modern Compiler Implementation in C. Cambridge University Press, Cambridge, UK. Google Scholar
Digital Library
- ARM 2003. ARM7TDMI Technical Reference Manual 4th Ed. Document No. ARM DDI0210B.Google Scholar
- Baker, T. 1990. A stack-based resource allocation policy for realtime processes. In Proceedings of the Real-Time Systems Symposium. 191--200.Google Scholar
Cross Ref
- Behren, R. V., Condit, J., Zhou, F., Necula, G. C., and Brewer, E. 2003. Capriccio: Scalable threads for internet services. In Proceedings of the 19th ACM Symposium on Operating Systems Principles. ACM Press, New York. 268--281. Google Scholar
Digital Library
- Bennett, M. and Audsley, N. 2001. Predictable and efficient virtual addressing for safety-critical real-time systems. In Proceedings of the 13th Euromicro Conference on Real-Time Systems. Delft, The Netherlands. IEEE Computer Society, Los Alamitos, CA. 183--190. Google Scholar
Digital Library
- Biswas, S., Simpson, M., Carley, T., Middha, B., and Barua, R. 2006. Memory overflow protection for embedded systems using run-time checks, reuse and compression. ACM Trans. Embed. Comput. Syst. To Appear. Google Scholar
Digital Library
- Bobrow, D. and Wegbreit, B. 1973. A model and stack implementation of multiple environments. Comm. ACM. 591--603. Google Scholar
Digital Library
- Brylow, D., Damgaard, N., and Palsberg, J. 2000. Stack-size estimation for interrupt-driven microcontrollers. Tech. rep. Purdue University.Google Scholar
- Brylow, D., Damgaard, N., and Palsberg, J. 2001. Static checking of interrupt-driven software. In Proceedings of the 23rd International Conference on Software Engineering. 47--56. Google Scholar
Digital Library
- Carbone, J. 2004. Efficient memory protection for embedded systems. RTC Magazine.Google Scholar
- Dionne, D. J. 1998. uClinux -- Embedded Linux Microcontroller Project.Google Scholar
- Durrant, M. 2000. Running linux on low cost, low power mmu-less processors. http://www.linuxdevices.com/articles/AT6245686197.html.Google Scholar
- GCC. The GCC Compiler. http://gcc.gnu.org/.Google Scholar
- GDB. GDB: The GNU Project Debugger. http://www.gnu.org/software/gdb/gdb.html.Google Scholar
- Grunwald, D. and Neves, R. 1996. Whole-program optimization for time and space efficient threads. In Proceedings of the 7th International Conference on Architectural Support for Programming Languages and Operating Systems. ACM Press, New York. 50--59. Google Scholar
Digital Library
- Guthaus, M. R., Ringenberg, J. S., Ernst, D., Austin, T. M., Mudge, T., and Brown, R. B. 2001. Mibench: A free, commercially representative embedded benchmark suite. In Proceedings of the IEEE 4th Annual Workshop on Workload Characterization. Google Scholar
Digital Library
- Hauck, E. and Dent, B. 1968. Burroughs b 6500/b 7500 stack mechanism. In Proceedings of AFIPS SJCC. 32, 245--251.Google Scholar
- Hennessy, J. and Patterson, D. 2002. Computer Architecture: A Quantitative Approach 3rd Ed. Morgan Kaufmann, Burlington, MA. Google Scholar
Digital Library
- Hertz, M. and Berger, E. D. 2005. Quantifying the performance of garbage collection vs. explicit memory management. SIGPLAN Not. 40, 10, 313--326. Google Scholar
Digital Library
- Hogen, G. and Loogen, R. 1993. A new stack technique for the management of runtime structures in distributed implementations. Tech. rep., RWTH Aachen, Germany. http://citeseer.ist.psu.edu/hogen93new.html.Google Scholar
- Jagger, D. and Seal, D. 2000. ARM Architecture Reference Manual. Addison Wesley, Reading, MA. Google Scholar
Digital Library
- Kleidermacher, D. and Griglock, M. 2001. Safety-Critical Operating Systems. Embedded Syst. Program. 14, 10. http://www.embedded.com/story/-OEG20010829S0055.Google Scholar
- Middha, B. 2006. MTSS: Multi task stack sharing for embedded systems. M.S. thesis, University of Maryland, College Park, MD.Google Scholar
- Montanaro, J. et al. 1996. A 160MHz, 32b, 0.5W CMOS RISC microprocessor. IEEE J. Solid State Circuit 31, 11, 1703--1714.Google Scholar
Cross Ref
- Moore, R. 2001. Unbound stacks and stoppable tasks. http://www.programmersheaven.com/articles/smx/article3.htm.Google Scholar
- Panda, P. R., Catthoor, F., Dutt, N. D., Danckaert, K., Brockmeyer, E., Kulkarni, C., Vandercappelle, A., and Kjeldsberg, P. G. 2001. Data and memory optimization techniques for embedded systems. ACM Trans. Des. Autom. Electron. Syst. 6, 2, 149--206. Google Scholar
Digital Library
- Pizka, M. 1999. Thread segment stacks. In Proceedings of International Conference on Parallel and Distributed Processing Techniques and Applications.Google Scholar
- Regehr, J., Reid, A., and Webb, K. 2003. Eliminating stack overflow by abstract interpretation. In Proceedings of the 3rd International Conference on Embedded Software. Springer-Verlag, Berlin. 306--322.Google Scholar
- Shantanu Sardesai, D. M. and Dasgupta, P. 1998. Distributed cactus stacks: Runtime stack-sharing support for distributed parallel programs. In Proceedings of the International Conference on Parallel and Distributed Processing Techniques and Applications.Google Scholar
- Silberschatz, A. and Peter Baer Galvin, G. G. Operating Systems Concepts 7th Ed. John Wiley, New York. Google Scholar
Digital Library
- Sinha, A. and Chandrakasan, A. P. 2001. JouleTrack: A web based tool for software energy profiling. In Proceedings of the 38th Conference on Design Automation (DAC'01). 220--225. Google Scholar
Digital Library
- Tiwari, V., Malik, S., and Wolfe, A. 1994. Power analysis of embedded software: A first step towards software power minimization. In IEEE Trans. VLSI Syst. 437--445. Google Scholar
Digital Library
- Wang, Y. and Saksena, M. 1999. Scheduling fixed priority tasks using preemption threshold. In Proceedings of the 6th International Conference on Real Time Computer Systems and Applications. Google Scholar
Digital Library
- Witchel, E., Cates, J., and Asanović, K. 2002. Mondrian memory protection. In Proceedings of the 10th International Conference on Architectural Support for Programming Languages and Operating Systems. ACM Press, New York. 304--316. Google Scholar
Digital Library
- Wong, K.-F. and Dageville, B. 1994. Supporting thousands of threads using a hybrid stack sharing scheme. In Proceedings of the ACM Symposium on Applied Computing. ACM Press, New York. 493--498. Google Scholar
Digital Library
Index Terms
MTSS: Multitask stack sharing for embedded systems
Recommendations
MTSS: multi task stack sharing for embedded systems
CASES '05: Proceedings of the 2005 international conference on Compilers, architectures and synthesis for embedded systemsOut-of-memory errors are a serious source of unreliability in most embedded systems [22]. Applications run out of main memory because of the frequent difficulty of estimating the memory requirement before deployment, either because it depends on input ...
Memory overflow protection for embedded systems using run-time checks, reuse and compression
CASES '04: Proceedings of the 2004 international conference on Compilers, architecture, and synthesis for embedded systemsOut-of-memory errors are a serious source of unreliability in most embedded systems. Applications run out of main memory because of the frequent difficulty of estimating the memory requirement before deployment, either because it depends on input data, ...
Memory overflow protection for embedded systems using run-time checks, reuse, and compression
Embedded systems usually lack virtual memory and are vulnerable to memory overflow since they lack a mechanism to detect overflow or use swap space thereafter. We present a method to detect memory overflows using compiler-inserted software run-time ...






Comments