- Timestamp:
-
02/16/15 14:59:00 (9 years ago)
- Author:
-
Sebastian Huber
- Comment:
-
Fix layout
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v88
|
v89
|
|
1 | | = SMP = |
2 | | |
3 | | |
4 | | |
5 | | [[TOC(Developer/SMP, depth=2)]] |
| 1 | [[TOC(Developer/SMP, depth=3)]] |
6 | 2 | |
7 | 3 | = Status of Effort = |
… |
… |
|
117 | 113 | = Design Issues = |
118 | 114 | |
119 | | = Low-Level Start = |
120 | | |
121 | | = Status = |
| 115 | == Low-Level Start == |
| 116 | |
| 117 | === Status === |
122 | 118 | |
123 | 119 | |
… |
… |
|
130 | 126 | |
131 | 127 | |
132 | | = Future Directions = |
| 128 | === Future Directions === |
133 | 129 | |
134 | 130 | |
135 | 131 | None. |
136 | | = Processor Affinity = |
137 | | |
138 | | = Status = |
| 132 | == Processor Affinity == |
| 133 | |
| 134 | === Status === |
139 | 135 | |
140 | 136 | |
… |
… |
|
142 | 138 | |
143 | 139 | The APIs for <sys/cpuset.h>, pthread affinity, and Classic API task affinity have been community reviewed and patches have been posted. The current work is "data complete" in that one can get and set using the APIs but no scheduler currently supports affinity. |
144 | | = Background = |
| 140 | === Background === |
145 | 141 | |
146 | 142 | |
… |
… |
|
161 | 157 | |
162 | 158 | Work remains to be done on adding affinity to a new SMP Scheduler variant. The current plan calls for having the schedulers without affinity ignore input on a set affinity operation and return a cpu set with all CPUs set on all get affinity operations. A new SMP scheduler variant will be added to support affinity. Initially, this scheduler will only be sufficient to properly manage the thread's CPU set as a data element. Then an assignment algorithm will be added. |
163 | | = Theory = |
| 159 | === Theory === |
164 | 160 | |
165 | 161 | |
… |
… |
|
253 | 249 | [[Image(rtems-smp-affinity.png)]] |
254 | 250 | |
255 | | = Atomic Operations = |
256 | | |
257 | | = Status = |
| 251 | == Atomic Operations == |
| 252 | |
| 253 | === Status === |
258 | 254 | |
259 | 255 | |
… |
… |
|
323 | 319 | .size release, .-release |
324 | 320 | .ident "GCC: (GNU) 4.9.0 20130917 (experimental)" |
325 | | = Future Directions = |
| 321 | === Future Directions === |
326 | 322 | |
327 | 323 | |
328 | 324 | * Review and integrate the GSoC work. |
329 | 325 | * Make use of atomic operations. |
330 | | = SMP Locks = |
331 | | |
332 | | = Status = |
| 326 | == SMP Locks == |
| 327 | |
| 328 | === Status === |
333 | 329 | |
334 | 330 | |
335 | 331 | SMP locks are implemented as a ticket lock using CPU architecture specific atomic operations. The SMP locks use a local context to be able to use scalable lock implementations like the Mellor-Crummey and Scotty (MCS) queue-based locks. |
336 | | = Future Directions = |
| 332 | === Future Directions === |
337 | 333 | |
338 | 334 | |
339 | 335 | Introduce read-write locks. Use phase-fair read-write lock implementation. This can be used for example by the time management code. The system time may be read frequently, but updates are infrequent. |
340 | | = ISR Locks = |
341 | | |
342 | | = Status = |
| 336 | == ISR Locks == |
| 337 | |
| 338 | === Status === |
343 | 339 | |
344 | 340 | |
… |
… |
|
349 | 345 | on single processor configurations. On SMP configurations they use an SMP lock |
350 | 346 | to ensure mutual exclusion throughout the system. |
351 | | = Future Directions = |
| 347 | === Future Directions === |
352 | 348 | |
353 | 349 | |
354 | 350 | * See [wiki:#SMP_Locks SMP locks]. |
355 | 351 | * Ensure via a RTEMS assertion that normal interrupt disable/sequences are only used intentional outside of the Giant lock critical sections. Review usage of ISR disable/enable sequences of the complete code base. |
356 | | = Giant Lock vs. Fine Grained Locking = |
357 | | |
358 | | = Status = |
| 352 | == Giant Lock vs. Fine Grained Locking == |
| 353 | |
| 354 | === Status === |
359 | 355 | |
360 | 356 | |
… |
… |
|
383 | 379 | likely lead to undesirable high worst case latencies which linear increase with |
384 | 380 | the processor count <ref name="Brandenburg2011">[https://www.cs.unc.edu/~anderson/diss/bbbdiss.pdf Björn B. Brandenburg, Scheduling and Locking in Multiprocessor Real-Time Operating Systems, 2011.]</ref>. |
385 | | = Future Directions = |
| 381 | === Future Directions === |
386 | 382 | |
387 | 383 | |
… |
… |
|
421 | 417 | Thus the scheduler needs its own locks. This will lead to nested locking and |
422 | 418 | deadlocks must be prevented. |
423 | | = Watchdog Handler = |
424 | | |
425 | | = Status = |
| 419 | == Watchdog Handler == |
| 420 | |
| 421 | === Status === |
426 | 422 | |
427 | 423 | |
… |
… |
|
429 | 425 | RTEMS. It is a core service of the operating system and used by the high level APIs. It is used for time of day maintenance and time events based on ticks or |
430 | 426 | wall clock time for example. The term ''watchdog'' has nothing to do with hardware watchdogs. |
431 | | = Future Directions = |
| 427 | === Future Directions === |
432 | 428 | |
433 | 429 | |
… |
… |
|
435 | 431 | watchdog resource leads to scalability problems. A SMP system is scalable if additional processors will increase the performance metrics. If we add more processors, then in general the number of timers increases proportionally and thus leads to longer delta chains. Also the chance for lock contention increases. Thus the watchdog resource should |
436 | 432 | move to the scheduler scope with per scheduler instances. Additional processors can then use new scheduler instances. |
437 | | = Per-CPU Control = |
438 | | |
439 | | = Status = |
| 433 | == Per-CPU Control == |
| 434 | |
| 435 | === Status === |
440 | 436 | |
441 | 437 | |
… |
… |
|
445 | 441 | code. CPU ports can add custom fields to the per-CPU control. This is used on |
446 | 442 | SPARC for the ISR dispatch disable indication. |
447 | | = Future Directions = |
| 443 | === Future Directions === |
448 | 444 | |
449 | 445 | |
450 | 446 | None. |
451 | | = Interrupt Support = |
452 | | |
453 | | = Status = |
| 447 | == Interrupt Support == |
| 448 | |
| 449 | === Status === |
454 | 450 | |
455 | 451 | |
456 | 452 | The interrupt support is BSP specific in general. |
457 | | = Future Directions = |
| 453 | === Future Directions === |
458 | 454 | |
459 | 455 | |
460 | 456 | * The SMP capable BSPs should implement the [http://www.rtems.org/onlinedocs/doxygen/cpukit/html/group__rtems__interrupt__extension.html Interrupt Manager Extension]. |
461 | 457 | * Add interrupt processor affinity API to ''Interrupt Manager Extension''. This should use the affinity sets API used for thread processor affinity. |
462 | | = Global Scheduler = |
463 | | |
464 | | = Status = |
| 458 | == Global Scheduler == |
| 459 | |
| 460 | === Status === |
465 | 461 | |
466 | 462 | |
… |
… |
|
468 | 464 | * Basic SMP support for schedulers like processor allocation and extended thread state information. |
469 | 465 | * Two global fixed priority schedulers (G-FP) are available with SMP support. |
470 | | = Future Directions = |
| 466 | === Future Directions === |
471 | 467 | |
472 | 468 | |
… |
… |
|
477 | 473 | * The new SMP schedulers lack test coverage. |
478 | 474 | * Implement clustered (or partitioned) scheduling with a sophisticated resource sharing protocol (e.g. <ref name="BurnsWellings2013">A. Burns and A.J. Wellings, A Schedulability Compatible Multiprocessor Resource Sharing Protocol - MrsP, Proceedings of the 25th Euromicro Conference on Real-Time Systems (ECRTS 2013), July 2013. </ref>). To benefit from this the Giant lock must be eliminated. |
479 | | = Clustered Scheduling = |
480 | | |
481 | | = Status = |
| 475 | == Clustered Scheduling == |
| 476 | |
| 477 | === Status === |
482 | 478 | |
483 | 479 | |
484 | 480 | Clustered scheduling is not supported. |
485 | | = Future Directions = |
| 481 | === Future Directions === |
486 | 482 | |
487 | 483 | |
… |
… |
|
512 | 508 | application-level threads in global resources - not the full task, only that |
513 | 509 | ''protected'' execution - in accord with <ref name="BurnsWellings2013"/>. |
514 | | = Task Variables = |
515 | | |
516 | | = Status = |
| 510 | == Task Variables == |
| 511 | |
| 512 | === Status === |
517 | 513 | |
518 | 514 | |
… |
… |
|
521 | 517 | of the executing thread. For Newlib the access to the re-entrancy structure is |
522 | 518 | now performed via ''__getreent()'', see also ''__DYNAMIC_REENT__'' in Newlib. The POSIX keys and the POSIX once function are now available for all RTEMS configurations (they no longer depend on POSIX enabled). Task variables have been replaced with POSIX keys for the RTEMS shell, the file system environment and the C++ support. |
523 | | = Future Directions = |
| 519 | === Future Directions === |
524 | 520 | |
525 | 521 | |
526 | 522 | * Fix Ada self task reference. |
527 | | = Non-Preempt Mode for Mutual Exclusion = |
528 | | |
529 | | = Status = |
| 523 | == Non-Preempt Mode for Mutual Exclusion == |
| 524 | |
| 525 | === Status === |
530 | 526 | |
531 | 527 | |
… |
… |
|
534 | 530 | a mode change request is issued. The alternatives are mutexes and condition |
535 | 531 | variables. |
536 | | = Future Directions = |
| 532 | === Future Directions === |
537 | 533 | |
538 | 534 | |
… |
… |
|
541 | 537 | * Fix the block device cache ''bdbuf''. |
542 | 538 | * Fix C++ support. |
543 | | = Thread Restart = |
544 | | |
545 | | = Status = |
| 539 | == Thread Restart == |
| 540 | |
| 541 | === Status === |
546 | 542 | |
547 | 543 | |
548 | 544 | The restart of threads is implemented. |
549 | | = Future Directions = |
| 545 | === Future Directions === |
550 | 546 | |
551 | 547 | |
… |
… |
|
572 | 568 | |
573 | 569 | This scheme could be used for all architectures. |
574 | | = Thread Delete = |
575 | | |
576 | | = Status = |
| 570 | == Thread Delete == |
| 571 | |
| 572 | === Status === |
577 | 573 | |
578 | 574 | |
579 | 575 | Deletion of threads is implemented. |
580 | | = Future Directions = |
| 576 | === Future Directions === |
581 | 577 | |
582 | 578 | |
583 | 579 | None. |
584 | | = Semaphores and Mutexes = |
585 | | |
586 | | = Status = |
| 580 | == Semaphores and Mutexes == |
| 581 | |
| 582 | === Status === |
587 | 583 | |
588 | 584 | |
… |
… |
|
590 | 586 | configurations this first acquires the Giant lock and then interrupts are |
591 | 587 | disabled. |
592 | | = Future Directions = |
| 588 | === Future Directions === |
593 | 589 | |
594 | 590 | |
… |
… |
|
597 | 593 | = Implementations = |
598 | 594 | |
599 | | = Tool Chain = |
600 | | |
601 | | = Binutils = |
| 595 | == Tool Chain == |
| 596 | |
| 597 | === Binutils === |
602 | 598 | |
603 | 599 | |
604 | 600 | A Binutils 2.24 or later release must be used due to the LEON3 support. |
605 | | = GCC = |
| 601 | === GCC === |
606 | 602 | |
607 | 603 | |
608 | 604 | A GCC 4.8 2013-11-25 (e.g. 4.8.3) or later must be used due to the LEON3 support. The LEON3 support for GCC includes a proper C11 memory model definition for this processor and C11 atomic operations using the CAS instruction. The backport of the LEON3 support was initiated by EB [http://gcc.gnu.org/ml/gcc-patches/2013-11/msg02255.html]. |
609 | | = GDB = |
610 | | |
611 | | |
612 | | Current GDB versions have problems with the debug format generated by GCC 4.8 and later [https://sourceware.org/bugzilla/show_bug.cgi?id=16215]. |
613 | | = Profiling = |
614 | | |
615 | | = Reason = |
| 605 | === GDB === |
| 606 | |
| 607 | A GDB 7.8.2 or later must be used since earlier versions have problems with the |
| 608 | debug format generated by GCC 4.8 and later |
| 609 | [https://sourceware.org/bugzilla/show_bug.cgi?id=16215]. |
| 610 | |
| 611 | == Profiling == |
| 612 | |
| 613 | === Implementation === |
616 | 614 | |
617 | 615 | |
… |
… |
|
619 | 617 | observability requirements. Vital timing data can be gathered on a per object |
620 | 618 | basis through profiling. |
621 | | = Status = |
| 619 | === Status === |
622 | 620 | |
623 | 621 | |
624 | 622 | CPU counter support is complete [http://git.rtems.org/rtems/commit/?id=24bf11eca11947d961cc9bb5f7d92dabff169e93]. The profiling support is complete [http://git.rtems.org/rtems/commit/?id=4dad4b84112d57cf6e77409f8e267706db446ec0]. |
625 | | = RTEMS API Changes = |
| 623 | === RTEMS API Changes === |
626 | 624 | |
627 | 625 | |
628 | 626 | None. |
629 | | = High-Performance CPU Counters = |
| 627 | === High-Performance CPU Counters === |
630 | 628 | |
631 | 629 | |
… |
… |
|
656 | 654 | */ |
657 | 655 | uint64_t _CPU_counter_To_nanoseconds( CPU_counter counter ) |
658 | | = SMP Lock Profiling = |
| 656 | === SMP Lock Profiling === |
659 | 657 | |
660 | 658 | |
… |
… |
|
780 | 778 | */ |
781 | 779 | void _SMP_lock_Iterate( SMP_lock_Visitor visitor, void *arg ); |
782 | | = Interrupt and Thread Profiling = |
| 780 | === Interrupt and Thread Profiling === |
783 | 781 | |
784 | 782 | |
… |
… |
|
865 | 863 | Per_CPU_Stats Stats; |
866 | 864 | }; |
867 | | = Interrupt Support = |
868 | | |
869 | | = Reason = |
| 865 | == Interrupt Support == |
| 866 | |
| 867 | === Implementation === |
870 | 868 | |
871 | 869 | |
… |
… |
|
873 | 871 | system. In combination with partitioned/clustered scheduling this can reduce |
874 | 872 | the amount of inter-processor synchronization and thread migrations. |
875 | | = Status = |
| 873 | === Status === |
876 | 874 | |
877 | 875 | |
878 | 876 | This is TBD. |
879 | | = RTEMS API Changes = |
| 877 | === RTEMS API Changes === |
880 | 878 | |
881 | 879 | |
… |
… |
|
931 | 929 | cpu_set_t *affinity_set |
932 | 930 | ); |
933 | | = Clustered Scheduling = |
934 | | |
935 | | = Reason = |
| 931 | == Clustered Scheduling == |
| 932 | |
| 933 | === Implementation === |
936 | 934 | |
937 | 935 | |
… |
… |
|
942 | 940 | scheduling it is possible to honor the cache topology of a system and thus |
943 | 941 | avoid expensive cache synchronization traffic. |
944 | | = Status = |
| 942 | === Status === |
945 | 943 | |
946 | 944 | |
947 | 945 | Support for clustered/partitioned scheduling is complete [http://git.rtems.org/rtems/commit/?id=c5831a3f9af11228dbdaabaf01f69d37e55684ef]. |
948 | | = RTEMS API Changes = |
| 946 | === RTEMS API Changes === |
949 | 947 | |
950 | 948 | |
… |
… |
|
1075 | 1073 | rtems_id *scheduler_id |
1076 | 1074 | ); |
1077 | | = Scheduler Configuration = |
| 1075 | === Scheduler Configuration === |
1078 | 1076 | |
1079 | 1077 | |
… |
… |
|
1167 | 1165 | configuration approach enables an additional error source which is avoided by |
1168 | 1166 | the processor configuration table. |
1169 | | = Scheduler Implementation = |
| 1167 | === Scheduler Implementation === |
1170 | 1168 | |
1171 | 1169 | |
… |
… |
|
1213 | 1211 | all dependencies explicit and easier to access (allows more efficient machine |
1214 | 1212 | code). |
1215 | | = Multiprocessor Resource Sharing Protocol - MrsP = |
1216 | | |
1217 | | = Reason = |
| 1213 | == Multiprocessor Resource Sharing Protocol - MrsP == |
| 1214 | |
| 1215 | === Implementation === |
1218 | 1216 | |
1219 | 1217 | |
… |
… |
|
1242 | 1240 | Feature (a) prevents lower-priority threads from running in preference to the waiting higher-priority thread and stealing resources that it might want to use in the future as part of the current execution; should that stealing happen, the blocking penalty potentially suffered on access to global resources would skyrocket to untenable levels. |
1243 | 1241 | Feature (b), which brings in the sole welcome extent of migration in the proposed model, which is useful when higher-priority tasks running on the processor of the global resource prevent it from completing execution; in that case, the slack allowed for by local spinning on other processors where other threads are waiting, is used to speed up the completion of the execution in the global resource and therefore reduce blocking. |
1244 | | = Status = |
| 1242 | === Status === |
1245 | 1243 | |
1246 | 1244 | |
1247 | 1245 | Implementation is complete [http://git.rtems.org/rtems/commit/?id=5c3d2509593476869e791111cd3d93cc1e840b3a]. |
1248 | | = RTEMS API Changes = |
| 1246 | === RTEMS API Changes === |
1249 | 1247 | |
1250 | 1248 | |
… |
… |
|
1292 | 1290 | size_t priority_ceilings_count |
1293 | 1291 | ); |
1294 | | = Implementation = |
| 1292 | === Implementation === |
1295 | 1293 | |
1296 | 1294 | |
… |
… |
|
1301 | 1299 | which is executing. A resource release will remove this thread from the |
1302 | 1300 | temporary scheduler domain and move it back to the original scheduler domain. |
1303 | | = Fine Grained Locking = |
1304 | | |
1305 | | = Reason = |
| 1301 | == Fine Grained Locking == |
| 1302 | |
| 1303 | === Implementation === |
1306 | 1304 | |
1307 | 1305 | |
… |
… |
|
1315 | 1313 | the operating system state is distributed allowing true parallelism of |
1316 | 1314 | independent components. |
1317 | | = Status = |
| 1315 | === Status === |
1318 | 1316 | |
1319 | 1317 | |
1320 | 1318 | This is TBD. |
1321 | | = RTEMS API Changes = |
| 1319 | === RTEMS API Changes === |
1322 | 1320 | |
1323 | 1321 | |
1324 | 1322 | None. |
1325 | | = Locking Protocol Analysis = |
| 1323 | === Locking Protocol Analysis === |
1326 | 1324 | |
1327 | 1325 | |
… |
… |
|
1458 | 1456 | wait_queue.set_sync_status(TIMEOUT) |
1459 | 1457 | wait_control = executing.get_wait_control() |
1460 | | wait_control.set_status(TIMEOUT) |
1461 | | <span style="color:red">ISR_enable(level)</span> |
1462 | | else: |
1463 | | <span style="color:red">ISR_enable(level)</span> |
1464 | | <span style |
| 1458 | wai |