summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/schedulerpriorityaffinitysmp.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* doxygen: Rename Score* groups in RTEMSScore*Sebastian Huber2019-04-041-1/+1
| | | | Update #3706
* score: Generalize SMP scheduler block supportSebastian Huber2018-09-031-0/+1
| | | | | | Add extract from scheduled function to the _Scheduler_SMP_Block() operation. This allows a scheduler implementation to do extra work in case a scheduled node is blocked.
* score: Optimize scheduler priority updatesSebastian Huber2017-11-201-107/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Use Processor_mask instead of cpu_set_tSebastian Huber2017-11-061-11/+5
|
* score: _Chain_Insert_ordered_unprotected()Sebastian Huber2017-11-061-3/+8
| | | | | | 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-18/+12
| | | | | | 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: Remove CPU_set_ControlSebastian Huber2017-10-111-6/+9
| | | | | | Use Processor_mask instead. Update #2514.
* posix: Validate affinity sets by the schedulerSebastian Huber2017-10-111-11/+8
| | | | Update #2514.
* score: Add simple affinity support to EDF SMPSebastian Huber2017-07-101-1/+2
| | | | Update #3059.
* score: Add scheduler node to set affinity opSebastian Huber2017-07-071-14/+2
| | | | Update #3059.
* score: Use processor mask for set affinitySebastian Huber2017-07-071-5/+8
| | | | Update #3059.
* score: Move processor affinity to Thread_ControlSebastian Huber2017-07-071-23/+0
| | | | Update #3059.
* score: Add red-black tree node to Scheduler_NodeSebastian Huber2017-06-291-1/+7
| | | | | | | In SMP configurations, add a red-black tree node to Scheduler_Node to enable an EDF scheduler implementation. Update #3056.
* Fix CPU_COPY() usageSebastian Huber2017-06-071-2/+2
| | | | | | | | The original CPU_COPY() support of Newlib <sys/cpuset.h> had the parameters in the wrong order. This is fixed in Newlib since 2017-05-22. Update #3023.
* score: Improve scheduler helping protocolSebastian Huber2017-02-031-5/+2
| | | | | | | | | | | 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.
* rtems: Add scheduler processor add/removeSebastian Huber2016-11-101-0/+30
| | | | Update #2797.
* score: Simplify yield and unblock scheduler opsSebastian Huber2016-11-021-17/+10
| | | | Update #2556.
* score: Delete Thread_Scheduler_control::nodeSebastian Huber2016-11-021-1/+1
| | | | Update #2556.
* score: Second part of new MrsP implementationSebastian Huber2016-11-021-8/+0
| | | | Update #2556.
* score: Delete unused scheduler ask for help X opSebastian Huber2016-11-021-20/+0
|
* score: Simplify update priority scheduler opSebastian Huber2016-11-021-8/+2
| | | | Remove unused return status.
* score: Add new SMP scheduler helping protocolSebastian Huber2016-11-021-1/+69
| | | | Update #2556.
* score: Pass scheduler node to unblock operationSebastian Huber2016-11-021-2/+4
| | | | | | Changed for consistency with other scheduler operations. Update #2556.
* score: Pass scheduler node to block operationSebastian Huber2016-11-021-2/+4
| | | | | | Changed for consistency with other scheduler operations. Update #2556.
* score: Pass scheduler node to update priority opSebastian Huber2016-11-021-1/+3
| | | | | | | 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-2/+2
| | | | | | | | 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: Simplify check for migrationsSebastian Huber2016-10-121-20/+4
|
* score: Change scheduler node init and destroySebastian Huber2016-07-011-14/+6
| | | | | | Provide the scheduler node to initialize or destroy to the corresponding operations. This makes it possible to have more than one scheduler node per thread.
* score: Fix priority affinity SMP schedulerSebastian Huber2016-07-011-2/+10
| | | | Bug introduced by 9bfad8cd519f17cbb26a672868169fcd304d5bd5.
* score: Strong APA scheduler processor allocationSebastian Huber2016-06-301-21/+0
| | | | | Use _Scheduler_SMP_Allocate_processor_exact() to prevent unexpected migrations.
* score: Add thread priority to scheduler nodesSebastian Huber2016-06-221-12/+8
| | | | | | | | | | | | | | | | | | 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.
* score: Avoid Giant lock _Scheduler_Set_affinity()Sebastian Huber2016-05-121-7/+18
| | | | Update #2555.
* score: Scheduler helping proto for affinity schedSebastian Huber2014-07-111-0/+12
| | | | | | | | | | | The priority affinity scheduler has the nice property that it can produce more than one scheduled to ready state change in one operation. Each scheduled to ready state change may lead to one thread in need for help. Since it is currently only possible to return at most one thread in need for help, we have a problem here. A solution might be to move the check for migrations into the ask for help mechanism.
* score: Fix scheduler helping implementationSebastian Huber2014-07-101-13/+6
| | | | | Do not extract the idle threads from the ready set so that there is always a thread available for comparison.
* score: Implement scheduler helping protocolSebastian Huber2014-07-091-7/+45
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* schedulerpriorityaffinitysmp.c: Add period at end of sentenceJoel Sherrill2014-07-081-1/+1
|
* score: Need for help indicator for scheduler opsSebastian Huber2014-07-081-18/+31
| | | | | | | | | | | | | 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: 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/+10
| | | | Avoid copy and paste and set the scheduler node state in one place.
* score: Rename _Scheduler_SMP_Update_heir()Sebastian Huber2014-07-081-1/+1
| | | | | | Rename and move _Scheduler_SMP_Update_heir() to _Thread_Dispatch_update_heir() since this function is not scheduler specific.
* score: Decouple thread and scheduler nodes on SMPSebastian Huber2014-06-231-83/+92
| | | | | | | 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: Move NULL pointer check to order functionSebastian Huber2014-06-121-2/+26
| | | | This helps to avoid untestable code for the normal SMP schedulers.
* score: Fix warningsSebastian Huber2014-06-121-2/+1
|
* Add SMP Priority Scheduler with AffinityJoel Sherrill2014-06-111-15/+487
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This scheduler attempts to account for needed thread migrations caused as a side-effect of a thread state, affinity, or priority change operation. This scheduler has its own allocate_processor handler named _Scheduler_SMP_Allocate_processor_exact() because _Scheduler_SMP_Allocate_processor() attempts to prevent an executing thread from moving off its current CPU without considering affinity. Without this, the scheduler makes all the right decisions and then they are discarded at the end. ==Side Effects of Adding This Scheduler== Added Thread_Control * parameter to Scheduler_SMP_Get_highest_ready type so methods looking for the highest ready thread can filter by the processor on which the thread blocking resides. This allows affinity to be considered. Simple Priority SMP and Priority SMP ignore this parameter. + Added get_lowest_scheduled argument to _Scheduler_SMP_Enqueue_ordered(). + Added allocate_processor argument to the following methods: - _Scheduler_SMP_Block() - _Scheduler_SMP_Enqueue_scheduled_ordered() - _Scheduler_SMP_Enqueue_scheduled_ordered() + schedulerprioritysmpimpl.h is a new file with prototypes for methods which were formerly static in schedulerprioritysmp.c but now need to be public to be shared with this scheduler. NOTE: _Scheduler_SMP_Get_lowest_ready() appears to have a path which would allow it to return a NULL. Previously, _Scheduler_SMP_Enqueue_ordered() would have asserted on it. If it cannot return a NULL, _Scheduler_SMP_Get_lowest_ready() should have an assertions.
* score: Replace _Scheduler_Allocate/Free()Sebastian Huber2014-06-041-3/+1
| | | | | | | | Replace _Scheduler_Allocate() with _Scheduler_Node_initialize(). Remove the return status and thus the node initialization must be always successful. Rename _Scheduler_Free() to _Scheduler_Node_destroy().
* score: Introduce scheduler nodesSebastian Huber2014-05-141-14/+17
| | | | | | | | | | | | Rename scheduler per-thread information into scheduler nodes using Scheduler_Node as the base type. Use inheritance for specialized schedulers. Move the scheduler specific states from the thread control block into the scheduler node structure. Validate the SMP scheduler node state transitions in case RTEMS_DEBUG is defined.
* score: Simplify thread control initializationSebastian Huber2014-04-151-5/+3
| | | | | | | | | | | The thread control block contains fields that point to application configuration dependent memory areas, like the scheduler information, the API control blocks, the user extension context table, the RTEMS notepads and the Newlib re-entrancy support. Account for these areas in the configuration and avoid extra workspace allocations for these areas. This helps also to avoid heap fragementation and reduces the per thread memory due to a reduced heap allocation overhead.
* score: Static scheduler configurationSebastian Huber2014-04-151-10/+10
| | | | | | Do not allocate the scheduler control structures from the workspace. This is a preparation step for configuration of clustered/partitioned schedulers on SMP.
* score: Add scheduler control to scheduler opsSebastian Huber2014-04-041-7/+16
| | | | | Scheduler operations must be free of a global scheduler context to enable partitioned/clustered scheduling.
* score: Add priority affinity smp scheduler.Jennifer Averett2014-04-031-0/+80