summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score/schedulerimpl.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Update company nameSebastian Huber2023-05-201-1/+1
| | | | | The embedded brains GmbH & Co. KG is the legal successor of embedded brains GmbH.
* Do not use RTEMS_INLINE_ROUTINESebastian Huber2022-09-191-31/+31
| | | | | | | Directly use "static inline" which is available in C99 and later. This brings the RTEMS implementation closer to standard C. Close #3935.
* score: Remove PRIORITY_PSEUDO_ISR thread prioritySebastian Huber2022-07-261-65/+0
| | | | | | | | | | | | | | | The uniprocessor schedulers had some special case logic for the PRIORITY_PSEUDO_ISR priority. Tasks with a priority of PRIORITY_PSEUDO_ISR were allowed to preempt a not preemptible task. If other higher priority task are made ready while a PRIORITY_PSEUDO_ISR task preempts a not preemptible task, then the other tasks run before the not preemptible task. This made the RTEMS_NO_PREEMPT mode ineffective. Remove the PRIORITY_PSEUDO_ISR special case logic. This simplifies the uniprocessor schedulers. Move the uniprocessor-specific scheduler support to the new header file <rtems/score/scheduleruniimpl.h>. Close #2365.
* cpukit/include/rtems/score/[s-z]*.h: Change license to BSD-2Joel Sherrill2022-02-281-3/+22
| | | | Updates #3053.
* score: Rework ask for help requestsSebastian Huber2021-11-231-24/+0
| | | | | | | | Process ask for help requests on the current processor. This avoids using inter-processor interrupts to make the system behaviour a bit more predictable. Update #4531.
* score: Move _Scheduler_Unblock_node()Sebastian Huber2021-11-231-42/+0
| | | | | | | Move _Scheduler_Unblock_node() into _Scheduler_SMP_Unblock(). This simplifies the code and makes it easier to review. Update #4531.
* score: Move _Scheduler_Block_node()Sebastian Huber2021-11-231-56/+0
| | | | | | | Move _Scheduler_Block_node() into _Scheduler_SMP_Block(). This simplifies the code and makes it easier to review. Update #4531.
* score: Rework idle handling in SMP schedulersSebastian Huber2021-11-231-177/+99
| | | | | | | | | | | | | | | | | | 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.
* score: Add SMP scheduler make/clean stickySebastian Huber2021-11-231-59/+0
| | | | | | | | | | | | | | | | | | | | 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.
* score: Simplify _Scheduler_Exchange_idle_thread()Sebastian Huber2021-11-231-7/+9
| | | | | | Remove superfluous idle parameter. Update #4531.
* score: Change _Scheduler_Try_to_schedule_node()Sebastian Huber2021-11-231-2/+2
| | | | | | Add the victim node as parameter instead of the idle thread. Update #4531.
* score: Not set CPU in _Scheduler_Use_idle_thread()Sebastian Huber2021-11-231-14/+8
| | | | | | | | Do not set the CPU of the idle thread in _Scheduler_Use_idle_thread(). This helps to use _Scheduler_Try_to_schedule_node() under more general conditions in the future, for example in case the owner and user of a node are not the same. Update #4531.
* score: Rename _Scheduler_Set_idle_thread()Sebastian Huber2021-11-231-22/+2
| | | | | | | Rename _Scheduler_Set_idle_thread() in _Scheduler_Node_set_idle_user() and move it to <rtems/score/schedulernodeimpl.h>. Update #4531.
* score: Simplify _Scheduler_Generic_block()Sebastian Huber2021-11-231-1/+1
| | | | | | If we block the executing thread and it is not the heir thread, then there is no need to run the schedule operation. The scheduler already selected a new heir.
* score: Introduce CPU budget operationsSebastian Huber2021-11-151-38/+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).
* rtems: Fix rate monotonic statisticsSebastian Huber2021-10-251-2/+2
| | | | | | | | | | | | | | | The rate monotonic period statistics were affected by rtems_cpu_usage_reset(). The logic to detect and work around a CPU usage reset was broken. The Thread_Contol::cpu_time_used is changed to contain the processor time used throughout the entire lifetime of the thread. The new member Thread_Contol::cpu_time_used_at_last_reset is added to contain the processor time used at the time of the last reset through rtems_cpu_usage_reset(). This decouples the resets of the CPU usage and the rate monotonic period statistics. Update #4528.
* score: Simplify _Scheduler_Tick()Sebastian Huber2021-08-121-4/+22
| | | | | | | | | | | | | | | | | | The NULL pointer check for the executing thread was introduced by commit: commit be3c257286ad870d8d1a64941cde53fd2d33a633 Author: Sebastian Huber <sebastian.huber@embedded-brains.de> Date: Thu Jun 5 11:17:26 2014 +0200 score: Avoid NULL pointer access Check that the executing thread is not NULL in _Scheduler_Tick(). It may be NULL in case the processor has an optional scheduler assigned and the system was not able to start the processor. However, it is no longer necessary since now the clock interrupt is distributed to the online processors.
* score: Replace priority prepend it with an enumSebastian Huber2021-08-121-2/+10
| | | | | | | | Use the new Priority_Group_order enum instead of a boolean to indicated if a priority should be inserted as the first or last node into its priority group. This makes the code more expressive. It is also a bit more efficient since a branch in _Scheduler_Node_set_priority() is avoided and a simple bitwise or operation can be used.
* Return status code for _Scheduler_Set_affinity()Sebastian Huber2021-04-271-9/+18
| | | | | This avoids having conditional statements to get the API-specific status code.
* rtems: Change rtems_task_get_affinity() statusSebastian Huber2021-04-271-1/+1
| | | | | | | | | In case the processor set is not large enough to contain the processor affinity set of the task return RTEMS_INVALID_SIZE instead of RTEMS_INVALID_NUMBER. This is more in line with other directives since the issue is related to the size of an object. Close #4393.
* Return status code for _Scheduler_Get_affinity()Sebastian Huber2021-04-271-3/+4
| | | | | This avoids having conditional statements to get the API-specific status code.
* score: Canonicalize Doxygen @file commentsSebastian Huber2020-12-021-4/+2
| | | | | | Use common phrases for the file brief descriptions. Update #3706.
* score: Canonicalize Doxygen groupsSebastian Huber2020-12-021-2/+4
| | | | | | | Adjust group identifier and names to be in line with a common pattern. Use common phrases for the group brief descriptions. Update #3706.
* score: Document _Scheduler_Try_to_schedule_node()Sebastian Huber2020-09-181-10/+34
|
* score: Improve Scheduler Handler documentationSebastian Huber2020-09-181-1/+28
|
* score: _Scheduler_Is_non_preempt_mode_supported()Sebastian Huber2020-02-251-0/+18
| | | | | | | | 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.
* score: Add and use _Thread_Get_unmapped_priority().Sebastian Huber2019-06-281-30/+0
| | | | Add and use _Thread_Get_unmapped_real_priority().
* doxygen: score: adjust doc in schedulerimpl.h to doxygen guidelinesAndreas Dachsberger2019-05-131-70/+227
| | | | Update #3706.
* doxygen: Rename Score* groups in RTEMSScore*Sebastian Huber2019-04-041-1/+1
| | | | Update #3706
* score: Add thread pin/unpin supportSebastian Huber2018-09-101-11/+9
| | | | | | | | | 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.
* score: Modify _Scheduler_Unblock()Sebastian Huber2018-09-101-5/+11
| | | | | | | | | In SMP configurations, obtain the scheduler node for the block and unblock operations through the same way via Thread_Control::Scheduler::Scheduler_node. This symmetry is important in a follow up patch which introduces thread pinning. Update #3508.
* Remove make preinstallChris Johns2018-01-251-0/+1203
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.