Abstract
The kernel spinlock has a non-negligible influence on the real-time performance of the multi-core RTOS. In order to protect mutual exclusive kernel data accessed in both task context and interrupt context by CPU-cores, the RTOS kernel uses existing FIFO spinlock algorithm as kernel spinlock must disable interrupt before acquiring lock, which will increase the interrupt response latency in the case of fierce competition for spinlock. In this work, the Interrupt Responsive Spinlock (IRS) mechanism based on MCS algorithm allows the CPU-cores to respond to interrupt during spin waiting, disable interrupt while holding spinlock, therefore the system can respond to interrupts in time without damaging OS kernel critical section. Besides, MCS-IRS maintains the compatibility with MCS semantics so that is transparent to the caller. Experiments show that MCS-IRS can eliminate the impact of spinlock fierce contention on Worst-Case Interrupt Response Latency, and has better multi-core scalability than MCS on Worst-Case Interrupt Disable Time, which can improve the real-time performance of multi-core RTOS.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Chen, G., Guan, N., Lü, M.S., Wang, Y.: State-of-the-art survey of real-time multicore system. Ruan Jian Xue Bao/J. Softw. 29, 2152–2176 (2018). https://doi.org/10.13328/j.cnki.jos.005580. (in Chinese)
Kuo, T.W., Chen, J.J., Chang, Y.H., Hsiu, P.C.: Real-time computing and the evolution of embedded system designs. In: Proceedings of Real-Time Systems Symposium, pp. 1–12. IEEE (2019). https://doi.org/10.1109/rtss.2018.00011
Lochmann, A., Borghorst, H.: LockDoc : trace-based analysis of locking in the Linux kernel. In: EuroSys 2019 (2019). https://doi.org/10.1145/3302424.3303948
Dinh, S., Li, J., Agrawal, K., Gill, C., Lu, C.: Blocking analysis for spin locks in real-time parallel tasks. IEEE Trans. Parallel Distrib. Syst. 29, 789–802 (2018). https://doi.org/10.1109/TPDS.2017.2777454
Mellor-Crummey, J.M., Scott, M.L.: Algorithms for scalable synchronization on shared-memory multiprocessors. ACM Trans. Comput. Syst. (TOCS) 21–65. (1991). https://doi.org/10.1145/103727.103729
Magnusson, P., Landin, A., Hagersten, E.: Queue locks on cache coherent multiprocessors. In: Proceedings of International Conference on Parallel Processing, pp. 165–171 (1994). https://doi.org/10.1109/ipps.1994.288305
Zhang, D., et al.: Efficient implementation of application-aware spinlock control in MPSoCs. Int. J. Embed. Real-Time Commun. Syst. 4, 64–84 (2013). https://doi.org/10.4018/jertcs.2013010104
Block, A., Leontyev, H., Brandenburg, B.B., Anderson, J.H.: A flexible real-time locking protocol for multiprocessors. In: Proceedings of 13th IEEE International Conference on Embedded and Real-Time Computing Systems and Applications, RTCSA 2007, pp. 47–56 (2007). https://doi.org/10.1109/rtcsa.2007.8
Cui, Y., Wang, Y., Chen, Y., Shi, Y.: Requester-based spin lock: a scalable and energy efficient locking scheme on multicore systems. IEEE Trans. Comput. 64, 166–179 (2015). https://doi.org/10.1109/TC.2013.196
Marotta, R., Tiriticco, D., Di Sanzo, P., Pellegrini, A., Quaglia, F.: Mutable locks: combining the best of spin and sleep locks. arXiv preprint arXiv:1906.00490 (2019)
Afshar, S., Behnam, M., Bril, R.J., Nolte, T.: Flexible spin-lock model for resource sharing in multiprocessor real-time systems. In: Proceedings of the 9th IEEE International Symposium on Industrial Embedded Systems, SIES 2014, pp. 41–51 (2014). https://doi.org/10.1109/sies.2014.6871185
Afshar, S., Behnam, M., Bril, R.J., Nolte, T.: An optimal spin-lock priority assignment algorithm for real-time multi-core systems. In: RTCSA 2017 - 23rd IEEE International Conference on Embedded and Real-Time Computing Systems and Applications (2017). https://doi.org/10.1109/rtcsa.2017.8046310
He, B., Scherer, W.N., Scott, M.L.: Preemption adaptivity in time-published queue-based spin locks. In: Bader, D.A., Parashar, M., Sridhar, V., Prasanna, V.K. (eds.) HiPC 2005. LNCS, vol. 3769, pp. 7–18. Springer, Heidelberg (2005). https://doi.org/10.1007/11602569_6
Teabe, B., Nitu, V., Tchana, A., Hagimont, D.: The lock holder and the lock waiter pre-emption problems: nip them in the bud using informed spinlocks (I-Spinlock). In: Proceedings of 12th European Conference on Computer Systems, EuroSys 2017 (2017). https://doi.org/10.1145/3064176.3064180
Ouyang, J., Lange, J.R.: Preemptable ticket spinlocks. ACM SIGPLAN Not. 48, 191 (2013). https://doi.org/10.1145/2517326.2451549
Wilhelm, R., et al.: The worst-case execution-time problem-overview of methods and survey of tools. Trans. Embed. Comput. Syst. 7, 1–47 (2008). https://doi.org/10.1145/1347375.1347389
Zhi-Hua, G., Zhi-Min, G.: WCET-aware task assignment and cache partitioning for wcrt minimization on multi-core systems. In: Proceedings of International Symposium on Parallel Architectures, Algorithms and Programming, PAAP, January 2016, pp. 143–148 (2016). https://doi.org/10.1109/paap.2015.36
Herlihy, M., Shavit, N.: The Art of Multiprocessor Programming, 1st edn. Morgan Kaufmann, San Francisco (2012)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2020 Springer Nature Singapore Pte Ltd.
About this paper
Cite this paper
Zheng, J., Bian, J., Kuang, J. (2020). Interrupt Responsive Spinlock Mechanism Based on MCS for Multi-core RTOS. In: Shen, H., Sang, Y. (eds) Parallel Architectures, Algorithms and Programming. PAAP 2019. Communications in Computer and Information Science, vol 1163. Springer, Singapore. https://doi.org/10.1007/978-981-15-2767-8_3
Download citation
DOI: https://doi.org/10.1007/978-981-15-2767-8_3
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-15-2766-1
Online ISBN: 978-981-15-2767-8
eBook Packages: Computer ScienceComputer Science (R0)