# Multiprocessor real-time scheduling with arbitrary processor affinities: from practice to theory

- 366 Downloads
- 3 Citations

## Abstract

Contemporary multiprocessor real-time operating systems, such as VxWorks, LynxOS, QNX, and real-time variants of Linux, allow a process to have an arbitrary processor affinity, that is, a process may be pinned to an arbitrary subset of the processors in the system. Placing such a hard constraint on process migrations can help to improve cache performance of specific multi-threaded applications, achieve isolation among applications, and aid in load-balancing. However, to date, the lack of schedulability analysis for such systems prevents the use of arbitrary processor affinities in predictable hard real-time systems. This paper presents the first analysis of multiprocessor scheduling with arbitrary processor affinities from a real-time systems perspective. It is shown that job-level fixed-priority scheduling with arbitrary processor affinities is strictly more general than global, clustered, and partitioned job-level fixed-priority scheduling combined. Concerning the more general case of job-level dynamic priorities, it is shown that global and clustered scheduling are equivalent to multiprocessor real-time scheduling with arbitrary processor affinities. The Linux push and pull scheduler is studied as a reference implementation and two approaches for the schedulability analysis of hard real-time tasks with arbitrary processor affinities are presented. In the first approach, the scheduling problem is reduced to “global-like” sub-problems to which existing global schedulability tests can be applied. The second approach is specifically based on response-time analysis and models the response-time computation as a linear optimization problem. The latter linear-programming-based approach has better runtime complexity than the former reduction-based approach. Schedulability experiments show the proposed techniques to be effective.

## Keywords

Multiprocessors Real-time systems Processor affinities Schedulability analysis## References

- Alfieri RA (1998) Apparatus and method for improved CPU affinity in a multiprocessor system. US Patent 5,745,778.Google Scholar
- Anderson JH, Bud V, Devi UC (2005) An EDF-based scheduling algorithm for multiprocessor soft real-time systems. In: Proceedings of the 17th Euromicro conference on real-time systems, ECRTS’05, pp 199–208Google Scholar
- Andersson B, Jonsson J (2000) Some insights on fixed-priority preemptive non-partitioned multiprocessor scheduling. In: Proceedings of the work-in-progress session of the 21st IEEE real-time systems symposium, RTSS’00Google Scholar
- Andersson B, Raravi G, Bletsas K (2010) Assigning real-time tasks on heterogeneous multiprocessors with two unrelated types of processors. In: Proceedings of the 31st IEEE real-time systems symposium, RTSS’10, pp 239–248Google Scholar
- Audsley NC, Burns A, Richardson MF, Wellings AJ (1991) Hard real-time scheduling: the deadline-monotonic approach. In: Proceedings of the 1991 IEEE workshop on real-time operating systems and software, pp. 133–137Google Scholar
- Audsley NC, Burns A, Richardson MF, Tindell K, Wellings AJ (1993) Applying new scheduling theory to static priority pre-emptive scheduling. Soft Eng J 8(5):284–292CrossRefGoogle Scholar
- Bado B, George L, Courbin P, Goossens J (2012) A semi-partitioned approach for parallel real-time scheduling. In: Proceedings of the 20th international conference on real-time and network systems, RTNS’12, pp. 151–160Google Scholar
- Baker TP, Baruah SK (2007) Schedulability analysis of multiprocessor sporadic task systems. In: Handbook of realtime and embedded systems, CRC Press, New YorkGoogle Scholar
- Baruah SK (2004) Partitioning real-time tasks among heterogeneous multiprocessors. In: Proceddings of the international conference on parallel processing, ICPP’04, pp. 467–474Google Scholar
- Baruah SK (2007) Techniques for multiprocessor global schedulability analysis. In: Proceedings of the 28th IEEE real-time systems symposium, RTSS’07, pp. 119–128Google Scholar
- Baruah SK, Bini E (2008) Partitioned scheduling of sporadic task systems: an ILP-based approach. In: DASIP’08 Conference on design and architectures for signal and image processing, BruxellesGoogle Scholar
- Baruah SK, Brandenburg BB (2013) Multiprocessor feasibility analysis of recurrent task systems with specified processor affinities. In: RTSS’13, Proceedings of the 34th IEEE real-time systems symposium, pp. 160–169Google Scholar
- Baruah SK, Cohen NK, Plaxton CG, Varvel DA (1996) Proportionate progress: a notion of fairness in resource allocation. Algorithmica 15:600–625MATHMathSciNetCrossRefGoogle Scholar
- Bastoni A, Brandenburg BB, Anderson JH (2011) Is semi-partitioned scheduling practical? In: ECRTS’11, Proceedings of the 23rd Euromicro conference on real-time systems, pp. 125–135Google Scholar
- Bertogna M, Cirinei M (2007) Response-time analysis for globally scheduled symmetric multiprocessor platforms. In: RTSS’07, Proceedings of the 28th IEEE real-time systems symposium, pp. 149–160Google Scholar
- Brandenburg BB (2011) Scheduling and locking in multiprocessor real-time operating systems. PhD thesis, University of North Carolina, CarolinaGoogle Scholar
- Burns A, Davis RI, Wang P, Zhang F (2012) Partitioned EDF scheduling for multiprocessors using a C=D task splitting scheme. Real-Time Syst 48:3–33MATHCrossRefGoogle Scholar
- Calandrino JM, Anderson JH, Baumberger DP (2007) A hybrid real-time scheduling approach for large-scale multicore platforms. In: ECRTS’07, Proceedings of the 19th Euromicro conference on real-time systems, pp. 247–258Google Scholar
- Davis RI, Burns A (2011a) Improved priority assignment for global fixed priority pre-emptive scheduling in multiprocessor real-time systems. Real-Time Syst 47(1):1–40MATHCrossRefGoogle Scholar
- Davis RI, Burns A (2011b) A survey of hard real-time scheduling for multiprocessor systems. ACM Comput Surv 43(4):35:1–35:44Google Scholar
- Dertouzos ML, Mok AK (1989) Multiprocessor online scheduling of hard-real-time tasks. IEEE Trans Soft Eng 15(12):1497–1506CrossRefGoogle Scholar
- Dorin F, Yomsi PM, Goossens J, Richard P (2010) Semi-partitioned hard real-time scheduling with restricted migrations upon identical multiprocessor platforms. CoRR abs/1006.2637Google Scholar
- Easwaran A, Shin I, Lee I (2009) Optimal virtual cluster-based multiprocessor scheduling. Real-Time Syst 43(1):25–59MATHCrossRefGoogle Scholar
- Eisenbrand F, Rothvoß T (2008) Static-priority real-time scheduling: Response time computation is NP-hard. In: RTSS’08, Proceedings of the 29th IEEE real-time systems symposium, pp. 397–406Google Scholar
- Eisenbrand F, Rothvoß T (2010) EDF-schedulability of synchronous periodic task systems is coNP-hard. In: Proceedings of the 21st annual ACM-SIAM symposium on discrete algorithms, pp. 1029–1034Google Scholar
- Emberson P, Stafford R, Davis RI (2010) Techniques for the synthesis of multiprocessor tasksets. In: Proceedings of the 1st International Workshop on Analysis Tools and Methodologies for Embedded and Real-time Systems, WATERS’10, pp 6–11.Google Scholar
- Fisher N, Goossens J, Baruah SK (2010) Optimal online multiprocessor scheduling of sporadic real-time tasks is impossible. Real-Time Systems 45(1–2):26–71MATHCrossRefGoogle Scholar
- Foong A, Fung J, Newell D (2004) An in-depth analysis of the impact of processor affinity on network performance. In: Proceedings of the 12th IEEE International Conference on Networks, ICON’04, pp 244–250.Google Scholar
- Foong A, Fung J, Newell D, Abraham S, Irelan P, Lopez-Estrada A (2005) Architectural characterization of processor affinity in network processing. In: Proceedings of the 2005 IEEE International Symposium on Performance Analysis of Systems and Software, pp 207–218.Google Scholar
- Funk SH (2004) EDF scheduling on heterogeneous multiprocessors. PhD thesis, The University of North Carolina at Chapel Hill.Google Scholar
- Gálvez JJ, Ruiz PM, Skarmeta AFG (2010) Heuristics for scheduling on restricted identical machines. University of Murcia, Spain, Tech. rep.Google Scholar
- Guan N, Stigge M, Yi W, Yu G (2009) New response time bounds for fixed priority multiprocessor scheduling. In: Proceedings of the 30th IEEE Real-Time Systems Symposium, RTSS’09, pp 387–397.Google Scholar
- Gujarati A, Cerqueira F, Brandenburg BB (2013) Schedulability analysis of the linux push and pull scheduler with arbitrary processor affinities. In: Proceedings of the 25th Euromicro Conference on Real-Time Systems, ECRTS’13, pp 69–79.Google Scholar
- Harbour M, Palencia JC (2003) Response time analysis for tasks scheduled under EDF within fixed priorities. In: Proceedings of the 24th IEEE Real-Time Systems Symposium, RTSS’03, pp 200–209.Google Scholar
- Jang HC, Jin HW (2009) MiAMI: Multi-core aware processor affinity for TCP/IP over multiple network interfaces. In: Proceedings of the 17th IEEE Symposium on High Performance Interconnects, HOTI’13, pp 73–82.Google Scholar
- Joseph M, Pandya P (1986) Finding response times in a real-time system. The Computer Journal 29(5):390–395MathSciNetCrossRefGoogle Scholar
- Kato S, Yamasaki N, Ishikawa Y (2009) Semi-partitioned scheduling of sporadic task systems on multiprocessors. In: Proceedings of the 21st Euromicro Conference on Real-Time Systems, ECRTS’09, pp 249–258.Google Scholar
- Lelli J, Lipari G, Faggioli D, Cucinotta T (2011) An efficient and scalable implementation of global EDF in Linux. In: Proceedings of the 7th International Workshop on Operating Systems Platforms for Embedded Real-Time Applications, OSPERT’11, pp 6–15.Google Scholar
- Leung JYT, Li CL (2008) Scheduling with processing set restrictions: A survey. International Journal of Production Economics 116(2):251–262MathSciNetCrossRefGoogle Scholar
- Leung JYT, Whitehead J (1982) On the complexity of fixed-priority scheduling of periodic, real-time tasks. Performance evaluation 2(4):237–250MATHMathSciNetCrossRefGoogle Scholar
- Lisper B, Mellgren P (2001) Response-time calculation and priority assignment with integer programming methods. In: Proceedings of the Work-in-Progress and Industrial Sessions of the 13th Euromicro Conference on Real-Time Systems, ECRTS’01.Google Scholar
- Liu CL, Layland JW (1973) Scheduling algorithms for multiprogramming in a hard-real-time environment. Journal of the ACM 20(1):46–61MATHMathSciNetCrossRefGoogle Scholar
- Lundberg L (1998) Multiprocessor scheduling of age constraint processes. In: Proceedings of the 5th International Conference on Real-Time Computing Systems and Applications, RTCSA’98, pp 42–47.Google Scholar
- Markatos E, LeBlanc T (1992) Using processor affinity in loop scheduling on shared-memory multiprocessors. In: Proceedings of Supercomputing’92, pp 104–113.Google Scholar
- Mok AK (1983) Fundamental design problems of distributed systems for the hard-real-time environment. Tech. rep, Massachusetts Institute of TechnologyGoogle Scholar
- Palencia J, Harbour MG (2005) Response time analysis of EDF distributed real-time systems. Journal of Embedded Computing 1(2):225–237Google Scholar
- Reddy D, Koufaty D, Brett P, Hahn S (2011) Bridging functional heterogeneity in multicore architectures. SIGOPS Operating Systems Review 45(1):21–33CrossRefGoogle Scholar
- Salehi JD, Kurose JF, Towsley D (1995) Further results in affinity-based scheduling of parallel networking. University of Massachusetts, Amherst, MAGoogle Scholar
- Zeng H, Di Natale M (2010) Improving real-time feasibility analysis for use in linear optimization methods. In: Proceedings of the 22nd Euromicro Conference on Real-Time Systems, ECRTS’10, pp 279–290.Google Scholar