skip to main content
research-article

Cross-layer customization for rapid and low-cost task preemption in multitasked embedded systems

Published:09 February 2009Publication History
Skip Abstract Section

Abstract

Preemptive multitasking is widely used in many low-cost and real-time embedded applications for its superior hardware utilization. The frequent and asynchronous context switches, however, require the preservation and restoration of the task state, thus resulting in a large number of memory transfer instructions. As a consequence, task responsiveness and application throughput can be significantly deteriorated. To address this problem we propose a cross-layer customization framework which through the close cooperation of compiler, OS, and hardware architecture achieves rapid and low-cost task switch. Application information extracted during compile-time regarding state liveness is exploited in order to preserve a minimal amount of task state on task preemption. We introduce two complementary techniques to implement the application-aware state preservation. The first technique utilizes compiler-generated custom routines which preserve/restore an extremely small live context at judiciously selected points in the application code. The second technique requires more sophisticated hardware support. It employs an OS-controlled register file mapping to achieve a rapid context switch. By mapping a small fraction of the register file in a single clock cycle, a context switch is achieved requiring no memory transfers for the majority of cases to preserve/restore the live state. The effect of aggressively replicated register files, where each task is given its own replica, is achieved with the hardware cost of only adding from 25% to 50% extra physical registers. Through the utilization of these novel mechanisms, a significant improvement on task response time is achieved as the context-switch cost is minimized.

References

  1. Aho, A., Sethi, R., and Ullman, J. 1986. Compilers: Principles, Techniques and Tools. Addison-Wesley, Boston, MA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Albrecht, C., Hagenau, R., and Doring, A. 2004. Cooperative software multithreading to enhance utilization of embedded processors for network applications. In Proceedings of the 12th Euromicro Workshop on Parallel, Distributed and Network-Based Processing (PDP'04), IEEE, Los Alamitos, CA, 300--307.Google ScholarGoogle Scholar
  3. ARM Ltd. ARM920T technical reference manual. ARM Ltd.Google ScholarGoogle Scholar
  4. Baker, T., Snyder, J., and Whalley, D. 1995. Fast context switches: Compiler and architectural support for preemptive scheduling. In Microprocessors and Microsystems, 35--42.Google ScholarGoogle Scholar
  5. Barthelmann, V. 2002. Inter-task register-allocation for static operating systems. In Proceedings of the Joint Conference of Languages, Compilers, and Tools for Embedded Systems and Software and Compilers for Embedded Systems (LCTES-SCOPES). ACM, New York, 149--154. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Bhatti, S., Carlson, J., Dai, H., Deng, J., Rose, J., Sheth, A., Shucker, B., Gruenwald, C., Torgerson, A., and Han, R. 2005. Mantis os: An embedded multithreaded operating system for wireless micro sensor platforms. Mob. Netw. Appl. (Special Issue on Wireless Sensor Networks) 10, 4, 563--579. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Bovet, D. and Cesati, M. 2002. Understanding the Linux Kernel 2nd Ed. O'Reilly, Sebastopol, CA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Byrd, G. and Holliday, M. 1995. Multithreaded processor architectures. IEEE Spectrum. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Chandra, A., Adler, M., Goyal, P., and Shenoy, P. 2000. Surplus fair scheduling: A proportional-share cpu scheduling algorithm for symmetric multiprocessors. In Proceedings of the Symposium on Operating System Design and Implementation. 45--58. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Dean, A. G. 2000. Software thread integration for hardware to software migration. Ph.D. thesis, Carnege Mellon University. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Dean, A. G. 2005. Software thread integration and synthesis for real-time applications. In Proceedings of the Conference on Design, Automation and Test in Europe (DATE). IEEE, Los Alamitos, CA, 68--69. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Faraboschi, P., Brown, G., Fisher, J., Desoli, G., and Homewood, F. 2000. Lx: A technology platform for customizable view embedded processing. In Proceedings of the International Symposium on Computer Architecture (ISCA). ACM, New York, 203--213. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Fisher, J., Faraboschi, P., and Young, C. 2005. Embedded Computing: A VLIW Approach to Architecture, Compilers and Tools. Morgan Kaufman, New York, NY.Google ScholarGoogle Scholar
  14. Guthaus, M., Ringenberg, J. S., Ernst, D., Austin, T., Mudge, T., and Brown, R. 2001. Mibench: A free, commercially representative embedded benchmark suite. In Proceedings of the 4th Annual Workshop on Workload Characterization (WWC-4). IEEE, Los Alamitos, CA, 3--14. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Hansson, H., Lawson, L., Bridal, O., Eriksson, C., Larsson, S., Lon, H., and Stromberg, M. 1997. Basement: An architecture and methodology for distributed automotive real-time systems. IEEE Trans. on Comput. 46, 9, 1016--1027. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Hill, J. and Culler, D. 2001. A wireless embedded sensor architecture for system-level optimization. Tech. rep. University of California, Berkeley.Google ScholarGoogle Scholar
  17. Hinton, G., Sager, D., Upton, M., Boggs, D., Carmean, D., Kyker, A., and Roussel, P. 2001. The microarchitecture of the pentium 4 processor. Intel Tech. J.Google ScholarGoogle Scholar
  18. Intel Corporation. Intel XScale Microarchitecture. Intel Corporation.Google ScholarGoogle Scholar
  19. Kessler, R. 1999. The alpha 21264 microprocessor. IEEE Micro 19, 1, 24--36. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Lee, C., Potkonjak, M., and Mangione-Smith, W. H. 1997. Mediabench: A tool for evaluating and synthesizing multimedia and communications systems. In Proceedings of the 30th Annual International Symposium on Microarchitecture (MICRO'30). IEEE, Los Alamitos, CA, 330--335. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Levis, P., Madden, S., Polastre, J., Szewczyk, R., Whitehouse, K., Woo, A., Gay, D., Hill, J., Welsh, M., Brewer, E., and Culler, D. 2005. Tinyos: An operating system for wireless sensor networks. Ambient Intelligence, Springer-Verlag, Berlin, Germany. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Merten, M., Trick, A., and Barnes, R. 2001. An architectural framework for runtime optimization. IEEE Trans. Comput. 50, 6, 567--589. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Nieh, J. and Lam, M. S. 2003. A smart scheduler for multimedia applications. ACM Trans. Comput. Syst. 21, 2, 117--163. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Oehmke, D., Binkert, N., Mudge, T., and Reinhardt, S. 2005. How to fake 1000 registers. InProceedings of the 38th Annual International Symposium on Microarchitecture (MICRO'38), IEEE, Los Alamitos, CA, 7--18. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Redstone, J., Eggers, S., and Levy, H. 2003. Mini-threads: Increasing tlp on small-scale smt processors. In Proceedings of the 9th International Symposium on High-Performance Computer Architecture (HPCA'03), IEEE, Los Alamitos, CA, 19--30. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Sastry, D. C. and Demirci, M. 1995. The qnx operating system. Computer 28, 11, 75--77. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Sherwood, T., Perelman, E., Sair, G. H. S., and Calder, B. 2003. Discovering and exploiting program phases. IEEE Micro 23, 6, 84--93. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Shivshankar, S., Vangara, S., and Dean, A. 2005. Balancing register pressure and context-switching delays in asti systems. In Proceedings of the 2005 International Conference on Compilers, Architectures and Synthesis for Embedded Systems, ACM, New York, 286--294. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. WINDRIVER. VxWorks, http://www.windriver.com.Google ScholarGoogle Scholar

Index Terms

  1. Cross-layer customization for rapid and low-cost task preemption in multitasked 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

      • Published in

        cover image ACM Transactions on Embedded Computing Systems
        ACM Transactions on Embedded Computing Systems  Volume 8, Issue 2
        January 2009
        243 pages
        ISSN:1539-9087
        EISSN:1558-3465
        DOI:10.1145/1457255
        Issue’s Table of Contents

        Copyright © 2009 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 9 February 2009
        • Accepted: 1 July 2008
        • Revised: 1 April 2008
        • Received: 1 October 2007
        Published in tecs Volume 8, Issue 2

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article
        • Research
        • Refereed
      • Article Metrics

        • Downloads (Last 12 months)1
        • Downloads (Last 6 weeks)1

        Other Metrics

      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!