summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score/scheduler.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-12-09Avoid ISR_LOCK_MEMBER() since it confuses DoxygenSebastian Huber1-2/+2
If RTEMS_SMP is not defined, then Doxygen adds the comments intended for conditional the lock member to the next member.
2021-11-23score: Add SMP scheduler make/clean stickySebastian Huber1-0/+75
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-15score: Introduce CPU budget operationsSebastian Huber1-17/+0
This patch set replaces the CPU budget algorithm enumeration with a set of CPU budget operations which implement a particular CPU budget algorithm. This helps to hide the CPU budget algorithm implementation details from the general thread handling. The CPU budget callouts are turned into CPU budget operations. This slightly reduces the size of the thread control block. All schedulers used the default scheduler tick implementation. The tick scheduler operation is removed and the CPU budget operations are directly used in _Watchdog_Tick() if the executing thread uses a CPU budget algorithm. This is performance improvement for all threads which do not use a CPU budget algorithm (default behaviour).
2021-09-21score: Remove unused default scheduler opsSebastian Huber1-46/+13
If SMP support is enabled and the system has exactly one processor, then it may use an uniprocessor scheduler. The ask for help, reconsider help request, and withdraw node operations can be NULL in this case, since they are only used if a thread has at least one helping scheduler node. At least two schedulers are required to get a helping node and each scheduler involved must own at least one processor. This is not possible on a system with exactly one processor.
2021-09-21score: Provide two thread pin/unpin defaultsSebastian Huber1-3/+24
The uniprocessor schedulers do not support systems with more than more processors. So they rivially support thread pinning and thus the SMP_FATAL_SCHEDULER_PIN_OR_UNPIN_NOT_SUPPORTED cannot happen. Add a second default implementation for SMP schedulers which do not support thread pinning. Change license to BSD-2-Clause according to file history and re-licensing agreement. Update #3053.
2021-09-21score: SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITYSebastian Huber1-2/+14
Rename SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY in SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION. Add Doxygen comment.
2021-09-21score: SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELPSebastian Huber1-2/+13
Rename SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP in SCHEDULER_DEFAULT_SMP_OPERATIONS. Add a Doxygen comment.
2021-04-27Return status code for _Scheduler_Set_affinity()Sebastian Huber1-4/+8
This avoids having conditional statements to get the API-specific status code.
2020-12-02score: Canonicalize Doxygen @file commentsSebastian Huber1-4/+3
Use common phrases for the file brief descriptions. Update #3706.
2020-09-18score: Improve Scheduler Handler documentationSebastian Huber1-13/+10
2020-02-25score: _Scheduler_Is_non_preempt_mode_supported()Sebastian Huber1-0/+8
If the non-preempt mode for threads is supported depends on the scheduler implementation. Add _Scheduler_Is_non_preempt_mode_supported() to indicate this. Update #3876.
2019-05-13doxygen: score: adjust doc in scheduler.h to doxygen guidelinesAndreas Dachsberger1-60/+65
Update #3706.
2019-04-04doxygen: Rename Score* groups in RTEMSScore*Sebastian Huber1-2/+2
Update #3706
2019-02-28Remove explicit file names from @fileSebastian Huber1-1/+1
This makes the @file documentation independent of the actual file name. Update #3707.
2018-09-10score: Add thread pin/unpin supportSebastian Huber1-0/+48
Add support to temporarily pin a thread to its current processor. This may be used to access per-processor data structures in critical sections with enabled thread dispatching, e.g. a pinned thread is allowed to block. Update #3508.
2018-01-25Remove make preinstallChris Johns1-0/+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.
2017-11-20score: Optimize scheduler priority updatesSebastian Huber1-4/+17
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: Remove superfluous includeSebastian Huber1-3/+0
Update #3059.
2017-09-27score: Rename to _Scheduler_ControlSebastian Huber1-2/+2
Rename struct Scheduler_Control to _Scheduler_Control to allow its use in standard header files, e.g. <pthread.h>. Update #3112.
2017-07-07score: Add scheduler node to set affinity opSebastian Huber1-0/+3
Update #3059.
2017-07-07score: Use processor mask for set affinitySebastian Huber1-11/+6
Update #3059.
2017-07-07score: Add processor set to scheduler contextSebastian Huber1-2/+2
Replace the simple processor count with the processor set owned by the scheduler instance. Update #3059.
2017-07-07score: Move processor affinity to Thread_ControlSebastian Huber1-27/+0
Update #3059.
2017-02-03score: Improve scheduler helping protocolSebastian Huber1-12/+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.
2017-01-11Remove obsolete __RTEMS_HAVE_SYS_CPUSET_H__Joel Sherrill1-3/+3
2016-11-10rtems: Add scheduler processor add/removeSebastian Huber1-1/+27
Update #2797.
2016-11-09score: Rename _Scheduler_AssignmentsSebastian Huber1-1/+1
Rename _Scheduler_Assignments into _Scheduler_Initial_assignments to make it clear that they may not reflect the run-time scheduler assignment. Update #2797.
2016-11-02score: Simplify yield and unblock scheduler opsSebastian Huber1-6/+6
Update #2556.
2016-11-02score: Delete unused scheduler ask for help X opSebastian Huber1-40/+1
2016-11-02score: Simplify update priority scheduler opSebastian Huber1-1/+1
Remove unused return status.
2016-11-02score: Use scheduler instance specific locksSebastian Huber1-0/+5
Update #2556.
2016-11-02score: Add new SMP scheduler helping protocolSebastian Huber1-0/+92
Update #2556.
2016-11-02score: Pass scheduler node to unblock operationSebastian Huber1-1/+2
Changed for consistency with other scheduler operations. Update #2556.
2016-11-02score: Pass scheduler node to block operationSebastian Huber1-1/+2
Changed for consistency with other scheduler operations. Update #2556.
2016-11-02score: Pass scheduler node to yield operationSebastian Huber1-1/+2
Changed for consistency with other scheduler operations. Update #2556.
2016-11-02score: Pass scheduler node to update priority opSebastian Huber1-1/+2
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-4/+4
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-09-21score: Rework thread priority managementSebastian Huber1-8/+20
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.
2016-09-08score: Move scheduler node to own header fileSebastian Huber1-159/+0
This makes it possible to add scheduler nodes to structures defined in <rtems/score/thread.h>. Update #2556.
2016-08-04score: Fix a release/cancel job race conditionSebastian Huber1-4/+8
Split up the potential thread priority change in the scheduler release/cancel job operation. Protect the rate monotonic period state with a dedicated SMP lock. This avoids a race condition during _Rate_monotonic_Timeout() while _Rate_monotonic_Cancel() is called on another processor.
2016-08-04score: Indroduce cancel job scheduler operationSebastian Huber1-0/+17
Do not use a deadline value of zero to indicate a job cancellation. Use a dedicated scheduler operation for this.
2016-07-01score: Change scheduler node init and destroySebastian Huber1-3/+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-06-22score: Add thread priority to scheduler nodesSebastian Huber1-27/+47
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-06-22score: Modify release job scheduler operationSebastian Huber1-2/+2
Pass the deadline in watchdog ticks to the scheduler. Update #2173.
2016-06-22score: Introduce map priority scheduler operationSebastian Huber1-0/+27
Introduce map/unmap priority scheduler operations to map thread priority values from/to the user domain to/from the scheduler domain. Use the map priority operation to validate the thread priority. The EDF schedulers use this new operation to distinguish between normal priorities and priorities obtain through a job release. Update #2173. Update #2556.
2016-06-22score: Delete unused _Scheduler_Priority_compare()Sebastian Huber1-6/+0
By convention, thread priorities must be integers in RTEMS. Smaller values represent more important threads.
2016-05-20score: Add per scheduler instance maximum prioritySebastian Huber1-0/+14
The priority values are only valid within a scheduler instance. Thus, the maximum priority value must be defined per scheduler instance. The first scheduler instance defines PRIORITY_MAXIMUM. This implies that RTEMS_MAXIMUM_PRIORITY and POSIX_SCHEDULER_MAXIMUM_PRIORITY are only valid for threads of the first scheduler instance. Further API/implementation changes are necessary to fix this. Update #2556.
2015-06-26score: Simplify <rtems/score/scheduler.h>Sebastian Huber1-3/+4
Drop the <rtems/score/percpu.h> include since this file exposes a lot of implementation details.
2015-03-06Fix even more Doxygen issuesJoel Sherrill1-1/+3
2014-11-24_Scheduler_FIXME_thread_priority_queues_are_brokenSebastian Huber1-9/+0
Delete this variable since it is no longer necessary due to the thread priority queue implementation change to use RB trees.