summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/schedulersmpimpl.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove make preinstallChris Johns2018-01-251-1482/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A speciality of the RTEMS build system was the make preinstall step. It copied header files from arbitrary locations into the build tree. The header files were included via the -Bsome/build/tree/path GCC command line option. This has at least seven problems: * The make preinstall step itself needs time and disk space. * Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error. * There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult. * The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit. * An introduction of a new build system is difficult. * Include paths specified by the -B option are system headers. This may suppress warnings. * The parallel build had sporadic failures on some hosts. This patch removes the make preinstall step. All installed header files are moved to dedicated include directories in the source tree. Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc, etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g. erc32, imx, qoriq, etc. The new cpukit include directories are: * cpukit/include * cpukit/score/cpu/@RTEMS_CPU@/include * cpukit/libnetworking The new BSP include directories are: * bsps/include * bsps/@RTEMS_CPU@/include * bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include There are build tree include directories for generated files. The include directory order favours the most general header file, e.g. it is not possible to override general header files via the include path order. The "bootstrap -p" option was removed. The new "bootstrap -H" option should be used to regenerate the "headers.am" files. Update #3254.
* score: Optimize scheduler priority updatesSebastian Huber2017-11-201-110/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thread priority changes may append or prepend the thread to its priority group on the scheduler ready queue. Previously, a separate priority value and a prepend-it flag in the scheduler node were used to propagate a priority change to the scheduler. Now, use an append-it bit in the priority control and reduce the plain priority value to 63 bits. This change leads to a significant code size reduction (about 25%) of the SMP schedulers. The negligible increase of the standard priority scheduler is due to some additional shift operations (SCHEDULER_PRIORITY_MAP() and SCHEDULER_PRIORITY_UNMAP()). Before: text filename 136 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleblock.o 464 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimplechangepriority.o 24 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimple.o 108 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleschedule.o 292 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleunblock.o 264 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleyield.o text filename 280 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityblock.o 488 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerprioritychangepriority.o 200 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriority.o 164 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityschedule.o 328 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityunblock.o 200 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityyield.o text filename 24112 arm-rtems5/c/imx7/cpukit/score/src/libscore_a-scheduleredfsmp.o text filename 37204 sparc-rtems5/c/gr740/cpukit/score/src/libscore_a-scheduleredfsmp.o text filename 42236 powerpc-rtems5/c/qoriq_e6500_32/cpukit/score/src/libscore_a-scheduleredfsmp.o After: text filename 136 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleblock.o 272 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimplechangepriority.o 24 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimple.o 108 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleschedule.o 292 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleunblock.o 264 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleyield.o text filename 280 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityblock.o 488 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerprioritychangepriority.o 208 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriority.o 164 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityschedule.o 332 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityunblock.o 200 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityyield.o text filename 18860 arm-rtems5/c/imx7/cpukit/score/src/libscore_a-scheduleredfsmp.o text filename 28520 sparc-rtems5/c/gr740/cpukit/score/src/libscore_a-scheduleredfsmp.o text filename 32664 powerpc-rtems5/c/qoriq_e6500_32/cpukit/score/src/libscore_a-scheduleredfsmp.o
* score: _Chain_Insert_ordered_unprotected()Sebastian Huber2017-11-061-19/+39
| | | | | | Change the chain order relation to use a directly specified left hand side value. This is similar to _RBTree_Insert_inline() and helps the compiler to better optimize the code.
* score: Simplify SMP get lowest scheduledSebastian Huber2017-10-281-7/+4
| | | | | | There is no need to pass in the order relation since the scheduled threads reside on an already ordered chain. The caller will decide what to do with the lowest scheduled thread.
* score: Add simple affinity support to EDF SMPSebastian Huber2017-07-101-5/+135
| | | | Update #3059.
* score: Pass scheduler nodes to processor allocatorSebastian Huber2017-07-071-18/+14
| | | | | | | This allows scheduler implementations to easily access scheduler-specific data. Update #3059.
* score: Add red-black tree node to Scheduler_NodeSebastian Huber2017-06-291-9/+9
| | | | | | | In SMP configurations, add a red-black tree node to Scheduler_Node to enable an EDF scheduler implementation. Update #3056.
* score: Fix scheduler yield in SMP configurationsSebastian Huber2017-03-071-2/+2
| | | | | | | | | Check that no ask help request is registered during unblock and yield scheduler operations. There is no need to ask for help if a scheduled thread yields, since this is already covered by the pre-emption detection. Update #2556.
* score: Improve scheduler helping protocolSebastian Huber2017-02-031-8/+10
| | | | | | | | | | | Only register ask for help requests in the scheduler unblock and yield operations. The actual ask for help operation is carried out during _Thread_Do_dispatch() on a processor related to the thread. This yields a better separation of scheduler instances. A thread of one scheduler instance should not be forced to carry out too much work for threads on other scheduler instances. Update #2556.
* score: Delete obsolete scheduler debug aidSebastian Huber2016-11-231-6/+0
|
* rtems: Add scheduler processor add/removeSebastian Huber2016-11-101-0/+92
| | | | Update #2797.
* score: Add scheduler to per-CPU informationSebastian Huber2016-11-091-1/+1
| | | | | | | This makes it possible to adjust the scheduler of a processor at run-time. Update #2797.
* score: Simplify yield and unblock scheduler opsSebastian Huber2016-11-021-70/+45
| | | | Update #2556.
* score: Delete Thread_Scheduler_control::own_nodeSebastian Huber2016-11-021-1/+1
| | | | Update #2556.
* score: Delete Thread_Scheduler_control::nodeSebastian Huber2016-11-021-1/+1
| | | | Update #2556.
* score: Delete Scheduler_Node::accepts_helpSebastian Huber2016-11-021-6/+1
| | | | Update #2556.
* score: Second part of new MrsP implementationSebastian Huber2016-11-021-26/+72
| | | | Update #2556.
* score: Delete unused scheduler ask for help X opSebastian Huber2016-11-021-55/+0
|
* score: Simplify update priority scheduler opSebastian Huber2016-11-021-11/+6
| | | | Remove unused return status.
* score: Yield support for new SMP helping protocolSebastian Huber2016-11-021-3/+8
| | | | Update #2556.
* score: Add new SMP scheduler helping protocolSebastian Huber2016-11-021-6/+167
| | | | Update #2556.
* score: Protect thread CPU by thread scheduler lockSebastian Huber2016-11-021-12/+24
| | | | Update #2556.
* score: Protect thread scheduler state changesSebastian Huber2016-11-021-24/+33
| | | | Update #2556.
* score: Simplify _Scheduler_SMP_Node_change_state()Sebastian Huber2016-11-021-38/+26
| | | | Update #2556.
* score: Pass scheduler node to unblock operationSebastian Huber2016-11-021-19/+21
| | | | | | Changed for consistency with other scheduler operations. Update #2556.
* score: Pass scheduler node to block operationSebastian Huber2016-11-021-11/+16
| | | | | | Changed for consistency with other scheduler operations. Update #2556.
* score: Pass scheduler node to yield operationSebastian Huber2016-11-021-6/+6
| | | | | | Changed for consistency with other scheduler operations. Update #2556.
* score: Pass scheduler node to update priority opSebastian Huber2016-11-021-18/+34
| | | | | | | This enables to call this scheduler operation for all scheduler nodes available to a thread. Update #2556.
* score: Rename scheduler ask for help stuffSebastian Huber2016-11-021-1/+1
| | | | | | | | Rename the scheduler ask for help stuff since this will be replaced step by step with a second generation of the scheduler helping protocol. Keep the old one for now in parallel to reduce the patch set sizes. Update #2556.
* score: Fix _Scheduler_Try_to_schedule_node() usageSebastian Huber2016-11-021-72/+65
| | | | Fix wrong use of continue statement in while loops.
* score: Rework thread priority managementSebastian Huber2016-09-211-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Add priority nodes which contribute to the overall thread priority. The actual priority of a thread is now an aggregation of priority nodes. The thread priority aggregation for the home scheduler instance of a thread consists of at least one priority node, which is normally the real priority of the thread. The locking protocols (e.g. priority ceiling and priority inheritance), rate-monotonic period objects and the POSIX sporadic server add, change and remove priority nodes. A thread changes its priority now immediately, e.g. priority changes are not deferred until the thread releases its last resource. Replace the _Thread_Change_priority() function with * _Thread_Priority_perform_actions(), * _Thread_Priority_add(), * _Thread_Priority_remove(), * _Thread_Priority_change(), and * _Thread_Priority_update(). Update #2412. Update #2556.
* score: Remove superfluous SMP debug supportSebastian Huber2016-09-071-3/+0
| | | | This information turned out to be useless in the last couple of months.
* score: Strong APA scheduler processor allocationSebastian Huber2016-06-301-0/+21
| | | | | Use _Scheduler_SMP_Allocate_processor_exact() to prevent unexpected migrations.
* score: Add thread priority to scheduler nodesSebastian Huber2016-06-221-14/+39
| | | | | | | | | | | | | | | | | | The thread priority is manifest in two independent areas. One area is the user visible thread priority along with a potential thread queue. The other is the scheduler. Currently, a thread priority update via _Thread_Change_priority() first updates the user visble thread priority and the thread queue, then the scheduler is notified if necessary. The priority is passed to the scheduler via a local variable. A generation counter ensures that the scheduler discards out-of-date priorities. This use of a local variable ties the update in these two areas close together. For later enhancements and the OMIP locking protocol implementation we need more flexibility. Add a thread priority information block to Scheduler_Node and synchronize priority value updates via a sequence lock on SMP configurations. Update #2556.
* Revert "score: Avoid use of uninitialized variable"Sebastian Huber2016-05-111-1/+0
| | | | | | Sorry, I should not fix warnings unmindfully. This reverts commit 35c8efc9501b5f6b1a4dfeaa4b1aa6a1d6dbf08e.
* score: Avoid use of uninitialized variableSebastian Huber2016-05-111-0/+1
| | | | | Properly set the needs_help to NULL in _Scheduler_SMP_Enqueue_ordered() in case the thread is inserted into the ready set.
* score: Fix scheduler helping protocolSebastian Huber2015-05-111-77/+141
| | | | | | Account for priority changes of threads executing in a foreign partition. Exchange idle threads in case a victim node uses an idle thread and the new scheduled node needs an idle thread.
* smp: Fix scheduler helping protocol assertionsSebastian Huber2014-11-271-3/+5
|
* smp: Fix scheduler helping protocolLuca Bonato2014-11-241-4/+21
| | | | | | | | | | | | New test case for smptests/smpmrsp01. Fix _Scheduler_Block_node() in case the node is in the SCHEDULER_HELP_ACTIVE_RIVAL helping state. For example a rtems_task_suspend() on a task waiting for a MrsP semaphore. Fix _Scheduler_Unblock_node() in case the node is in the SCHEDULER_SMP_NODE_READY state. For example a rtems_task_resume() on a task owning or waiting for a MrsP semaphore.
* score: Fix scheduler helping implementationSebastian Huber2014-07-101-40/+19
| | | | | Do not extract the idle threads from the ready set so that there is always a thread available for comparison.
* score: Fix assertionsSebastian Huber2014-07-101-4/+0
|
* score: Implement scheduler helping protocolSebastian Huber2014-07-091-68/+301
| | | | | | | | | | | | | | | | | | | | | | | | | The following scheduler operations return a thread in need for help - unblock, - change priority, and - yield. A thread in need for help is a thread that encounters a scheduler state change from scheduled to ready or a thread that cannot be scheduled in an unblock operation. Such a thread can ask threads which depend on resources owned by this thread for help. Add a new ask for help scheduler operation. This operation is used by _Scheduler_Ask_for_help() to help threads in need for help returned by the operations mentioned above. This operation is also used by _Scheduler_Thread_change_resource_root() in case the root of a resource sub-tree changes. A use case is the ownership change of a resource. In case it is not possible to schedule a thread in need for help, then the corresponding scheduler node will be placed into the set of ready scheduler nodes of the scheduler instance. Once a state change from ready to scheduled happens for this scheduler node it may be used to schedule the thread in need for help.
* score: Need for help indicator for scheduler opsSebastian Huber2014-07-081-28/+54
| | | | | | | | | | | | | Return a thread in need for help for the following scheduler operations - unblock, - change priority, and - yield. A thread in need for help is a thread that encounters a scheduler state change from scheduled to ready or a thread that cannot be scheduled in an unblock operation. Such a thread can ask threads which depend on resources owned by this thread for help.
* score: Add _Scheduler_Help()Sebastian Huber2014-07-081-2/+2
| | | | Manage the help state of threads with respect to scheduling decisions.
* score: Rename *_Node_get() to *_Thread_get_node()Sebastian Huber2014-07-081-6/+6
| | | | | | This emphasizes that the scheduler node of a thread is returned and this is not a function working with scheduler nodes like the other *_Node_*() functions.
* score: Simplify SMP processor allocationSebastian Huber2014-07-081-15/+46
| | | | Avoid copy and paste and set the scheduler node state in one place.
* score: Rename _Scheduler_SMP_Update_heir()Sebastian Huber2014-07-081-30/+2
| | | | | | Rename and move _Scheduler_SMP_Update_heir() to _Thread_Dispatch_update_heir() since this function is not scheduler specific.
* score: Fix warningSebastian Huber2014-07-071-1/+1
|
* score: Decouple thread and scheduler nodes on SMPSebastian Huber2014-06-231-107/+146
| | | | | | | Add a chain node to the scheduler node to decouple the thread and scheduler nodes. It is now possible to enqueue a thread in a thread wait queue and use its scheduler node at the same for other threads, e.g. a resouce owner.
* score: Collect scheduler related fields in TCBSebastian Huber2014-06-231-1/+1
| | | | | Add Thread_Scheduler_control to collect scheduler related fields of the TCB.