summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/schedulerpriorityaffinitysmp.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-05-13score: Fix SMP priority affinity scheduler yieldSebastian Huber1-0/+1
2022-05-12score: Add SMP priority affinity scheduler yieldTian Ye1-0/+18
2022-02-28score/src/[n-s]*.c: Change license to BSD-2Joel Sherrill1-3/+22
Updates #3053.
2021-11-23score: _Scheduler_SMP_Schedule_highest_ready()Sebastian Huber1-4/+2
Simplify callers of _Scheduler_SMP_Schedule_highest_ready(). Move the node state change and the extraction from scheduled into _Scheduler_SMP_Schedule_highest_ready(). Move the idle thread release to the caller which have more information about the presence of an idle thread. Update #4531.
2021-11-23score: Add node to insert to Chain_Node_orderSebastian Huber1-2/+4
This allows to use additional members of the nodes for comparision. Update #4534.
2021-11-23score: Rework idle handling in SMP schedulersSebastian Huber1-10/+31
This patch fixes an issue with the idle thread handling in the SMP scheduler framework used for the MrsP locking protocol. The approach to use a simple chain of unused idle threads is broken for schedulers which support thread to processor affinity. The reason is that the thread to processor affinity introduces another ordering indicator which may under certain conditions lead to a reordering of idle threads in the scheduled chain. This reordering is not propagated to the chain of unused idle threads. This could lead to use an idle thread for a sticky scheduler node which is already in use. This locks up the system in infinite loops in the thread context switch procedure. To fix this, the SMP scheduler implementations must now provide callbacks to get and release an unused idle thread. Update #4531.
2021-11-23score: Add SMP scheduler make/clean stickySebastian Huber1-2/+37
This patch fixes the following broken behaviour: While a thread is scheduled on a helping scheduler, while it does not own a MrsP semaphore, if it obtains a MrsP semaphore, then no scheduler node using an idle thread and the ceiling priority of the semaphore is unblocked for the home scheduler. This could lead to priority inversion issues and is not in line with the MrsP protocol. Introduce two new scheduler operations which are only enabled if RTEMS_SMP is defined. The operations are used to make the scheduler node of the home scheduler sticky and to clean the sticky property. This helps to keep the sticky handing out of the frequently used priority update operation. Close #4532.
2021-11-23score: Use extract from scheduled callbacksSebastian Huber1-0/+3
Use the extract from scheduled callback provided by the scheduler implementation in the SMP scheduler framework. Update #4531.
2021-11-23score: Remove return value from enqueue scheduledSebastian Huber1-2/+2
The return value was unused. Remove it. Update #4531.
2021-04-27Return status code for _Scheduler_Set_affinity()Sebastian Huber1-4/+4
This avoids having conditional statements to get the API-specific status code.
2020-12-02score: Canonicalize Doxygen @file commentsSebastian Huber1-2/+12
Use common phrases for the file brief descriptions. Update #3706.
2020-04-16Canonicalize config.h includeSebastian Huber1-2/+2
Use the following variant which was already used by most source files: #ifdef HAVE_CONFIG_H #include "config.h" #endif
2019-04-04doxygen: Rename Score* groups in RTEMSScore*Sebastian Huber1-1/+1
Update #3706
2018-09-03score: Generalize SMP scheduler block supportSebastian Huber1-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.
2017-11-20score: Optimize scheduler priority updatesSebastian Huber1-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
2017-11-06score: Use Processor_mask instead of cpu_set_tSebastian Huber1-11/+5
2017-11-06score: _Chain_Insert_ordered_unprotected()Sebastian Huber1-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.
2017-10-28score: Simplify SMP get lowest scheduledSebastian Huber1-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.
2017-10-11score: Remove CPU_set_ControlSebastian Huber1-6/+9
Use Processor_mask instead. Update #2514.
2017-10-11posix: Validate affinity sets by the schedulerSebastian Huber1-11/+8
Update #2514.
2017-07-10score: Add simple affinity support to EDF SMPSebastian Huber1-1/+2
Update #3059.
2017-07-07score: Add scheduler node to set affinity opSebastian Huber1-14/+2
Update #3059.
2017-07-07score: Use processor mask for set affinitySebastian Huber1-5/+8
Update #3059.
2017-07-07score: Move processor affinity to Thread_ControlSebastian Huber1-23/+0
Update #3059.
2017-06-29score: Add red-black tree node to Scheduler_NodeSebastian Huber1-1/+7
In SMP configurations, add a red-black tree node to Scheduler_Node to enable an EDF scheduler implementation. Update #3056.
2017-06-07Fix CPU_COPY() usageSebastian Huber1-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.
2017-02-03score: Improve scheduler helping protocolSebastian Huber1-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.
2016-11-10rtems: Add scheduler processor add/removeSebastian Huber1-0/+30
Update #2797.
2016-11-02score: Simplify yield and unblock scheduler opsSebastian Huber1-17/+10
Update #2556.
2016-11-02score: Delete Thread_Scheduler_control::nodeSebastian Huber1-1/+1
Update #2556.
2016-11-02score: Second part of new MrsP implementationSebastian Huber1-8/+0
Update #2556.
2016-11-02score: Delete unused scheduler ask for help X opSebastian Huber1-20/+0
2016-11-02score: Simplify update priority scheduler opSebastian Huber1-8/+2
Remove unused return status.
2016-11-02score: Add new SMP scheduler helping protocolSebastian Huber1-1/+69
Update #2556.
2016-11-02score: Pass scheduler node to unblock operationSebastian Huber1-2/+4
Changed for consistency with other scheduler operations. Update #2556.
2016-11-02score: Pass scheduler node to block operationSebastian Huber1-2/+4
Changed for consistency with other scheduler operations. Update #2556.
2016-11-02score: Pass scheduler node to update priority opSebastian Huber1-1/+3
This enables to call this scheduler operation for all scheduler nodes available to a thread. Update #2556.
2016-11-02score: Rename scheduler ask for help stuffSebastian Huber1-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.
2016-10-12score: Simplify check for migrationsSebastian Huber1-20/+4
2016-07-01score: Change scheduler node init and destroySebastian Huber1-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.
2016-07-01score: Fix priority affinity SMP schedulerSebastian Huber1-2/+10
Bug introduced by 9bfad8cd519f17cbb26a672868169fcd304d5bd5.
2016-06-30score: Strong APA scheduler processor allocationSebastian Huber1-21/+0
Use _Scheduler_SMP_Allocate_processor_exact() to prevent unexpected migrations.
2016-06-22score: Add thread priority to scheduler nodesSebastian Huber1-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.
2016-05-12score: Avoid Giant lock _Scheduler_Set_affinity()Sebastian Huber1-7/+18
Update #2555.
2014-07-11score: Scheduler helping proto for affinity schedSebastian Huber1-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.
2014-07-10score: Fix scheduler helping implementationSebastian Huber1-13/+6
Do not extract the idle threads from the ready set so that there is always a thread available for comparison.
2014-07-09score: Implement scheduler helping protocolSebastian Huber1-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.
2014-07-08schedulerpriorityaffinitysmp.c: Add period at end of sentenceJoel Sherrill1-1/+1
2014-07-08score: Need for help indicator for scheduler opsSebastian Huber1-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.
2014-07-08score: Rename *_Node_get() to *_Thread_get_node()Sebastian Huber1-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.