skip to main content
research-article

MTSS: Multitask stack sharing for embedded systems

Published:01 August 2008Publication History
Skip Abstract Section

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.

References

  1. Appel, A. W. 1987. Garbage collection can be faster than stack allocation. Inform. Process. Lett. 25, 4, 275--279. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Appel, A. W. and Ginsburg, M. 1998. Modern Compiler Implementation in C. Cambridge University Press, Cambridge, UK. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. ARM 2003. ARM7TDMI Technical Reference Manual 4th Ed. Document No. ARM DDI0210B.Google ScholarGoogle Scholar
  4. Baker, T. 1990. A stack-based resource allocation policy for realtime processes. In Proceedings of the Real-Time Systems Symposium. 191--200.Google ScholarGoogle ScholarCross RefCross Ref
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. Bobrow, D. and Wegbreit, B. 1973. A model and stack implementation of multiple environments. Comm. ACM. 591--603. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Brylow, D., Damgaard, N., and Palsberg, J. 2000. Stack-size estimation for interrupt-driven microcontrollers. Tech. rep. Purdue University.Google ScholarGoogle Scholar
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. Carbone, J. 2004. Efficient memory protection for embedded systems. RTC Magazine.Google ScholarGoogle Scholar
  12. Dionne, D. J. 1998. uClinux -- Embedded Linux Microcontroller Project.Google ScholarGoogle Scholar
  13. Durrant, M. 2000. Running linux on low cost, low power mmu-less processors. http://www.linuxdevices.com/articles/AT6245686197.html.Google ScholarGoogle Scholar
  14. GCC. The GCC Compiler. http://gcc.gnu.org/.Google ScholarGoogle Scholar
  15. GDB. GDB: The GNU Project Debugger. http://www.gnu.org/software/gdb/gdb.html.Google ScholarGoogle Scholar
  16. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. Hauck, E. and Dent, B. 1968. Burroughs b 6500/b 7500 stack mechanism. In Proceedings of AFIPS SJCC. 32, 245--251.Google ScholarGoogle Scholar
  19. Hennessy, J. and Patterson, D. 2002. Computer Architecture: A Quantitative Approach 3rd Ed. Morgan Kaufmann, Burlington, MA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Hertz, M. and Berger, E. D. 2005. Quantifying the performance of garbage collection vs. explicit memory management. SIGPLAN Not. 40, 10, 313--326. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. 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 ScholarGoogle Scholar
  22. Jagger, D. and Seal, D. 2000. ARM Architecture Reference Manual. Addison Wesley, Reading, MA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Kleidermacher, D. and Griglock, M. 2001. Safety-Critical Operating Systems. Embedded Syst. Program. 14, 10. http://www.embedded.com/story/-OEG20010829S0055.Google ScholarGoogle Scholar
  24. Middha, B. 2006. MTSS: Multi task stack sharing for embedded systems. M.S. thesis, University of Maryland, College Park, MD.Google ScholarGoogle Scholar
  25. Montanaro, J. et al. 1996. A 160MHz, 32b, 0.5W CMOS RISC microprocessor. IEEE J. Solid State Circuit 31, 11, 1703--1714.Google ScholarGoogle ScholarCross RefCross Ref
  26. Moore, R. 2001. Unbound stacks and stoppable tasks. http://www.programmersheaven.com/articles/smx/article3.htm.Google ScholarGoogle Scholar
  27. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  28. Pizka, M. 1999. Thread segment stacks. In Proceedings of International Conference on Parallel and Distributed Processing Techniques and Applications.Google ScholarGoogle Scholar
  29. 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 ScholarGoogle Scholar
  30. 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 ScholarGoogle Scholar
  31. Silberschatz, A. and Peter Baer Galvin, G. G. Operating Systems Concepts 7th Ed. John Wiley, New York. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  33. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  34. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  35. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  36. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. MTSS: Multitask stack sharing for embedded systems

                  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

                  Full Access

                  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!