summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/schedulercbs.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* score: Simplify yield and unblock scheduler opsSebastian Huber2016-11-021-1/+1
| | | | Update #2556.
* score: Pass scheduler node to unblock operationSebastian Huber2016-11-021-15/+2
| | | | | | Changed for consistency with other scheduler operations. Update #2556.
* score: Rework thread priority managementSebastian Huber2016-09-211-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | 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: Fix a release/cancel job race conditionSebastian Huber2016-08-041-14/+1
| | | | | | | | 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.
* score: Indroduce cancel job scheduler operationSebastian Huber2016-08-041-0/+1
| | | | | Do not use a deadline value of zero to indicate a job cancellation. Use a dedicated scheduler operation for this.
* score: Change scheduler node init and destroySebastian Huber2016-07-011-0/+1
| | | | | | 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: Add thread priority to scheduler nodesSebastian Huber2016-06-221-3/+3
| | | | | | | | | | | | | | | | | | 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: Modify release job scheduler operationSebastian Huber2016-06-221-1/+1
| | | | | | Pass the deadline in watchdog ticks to the scheduler. Update #2173.
* score: Introduce map priority scheduler operationSebastian Huber2016-06-221-0/+2
| | | | | | | | | | | 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.
* score: Delete unused _Scheduler_Priority_compare()Sebastian Huber2016-06-221-1/+0
| | | | | By convention, thread priorities must be integers in RTEMS. Smaller values represent more important threads.
* score: Add per scheduler instance maximum prioritySebastian Huber2016-05-201-0/+2
| | | | | | | | | | | 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.
* Fix even more Doxygen issuesJoel Sherrill2015-03-061-0/+2
|
* score: Implement scheduler helping protocolSebastian Huber2014-07-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | 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: Use default get/set affinity operationSebastian Huber2014-06-201-0/+1
| | | | Add and use SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY.
* score: Rename _Scheduler_Update()Sebastian Huber2014-06-041-1/+1
| | | | | | Rename _Scheduler_Update() to _Scheduler_Update_priority(). Add parameter for the new thread priority to avoid direct usage of Thread_Control::current_priority in the scheduler operation.
* score: Replace _Scheduler_Allocate/Free()Sebastian Huber2014-06-041-9/+4
| | | | | | | | 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: Simplify _Thread_Change_priority()Sebastian Huber2014-05-151-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | The function to change a thread priority was too complex. Simplify it with a new scheduler operation. This increases the average case performance due to the simplified logic. The interrupt disabled critical section is a bit prolonged since now the extract, update and enqueue steps are executed atomically. This should however not impact the worst-case interrupt latency since at least for the Deterministic Priority Scheduler this sequence can be carried out with a wee bit of instructions and no loops. Add _Scheduler_Change_priority() to replace the sequence of - _Thread_Set_transient(), - _Scheduler_Extract(), - _Scheduler_Enqueue(), and - _Scheduler_Enqueue_first(). Delete STATES_TRANSIENT, _States_Is_transient() and _Thread_Set_transient() since this state is now superfluous. With this change it is possible to get rid of the SCHEDULER_SMP_NODE_IN_THE_AIR state. This considerably simplifies the implementation of the new SMP locking protocols.
* score: Introduce scheduler nodesSebastian Huber2014-05-141-2/+2
| | | | | | | | | | | | 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-2/+2
| | | | | | | | | | | 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-9/+17
| | | | | | 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-3/+6
| | | | | Scheduler operations must be free of a global scheduler context to enable partitioned/clustered scheduling.
* Change all references of rtems.com to rtems.org.Chris Johns2014-03-211-1/+1
|
* scheduler: Add and use _Scheduler_default_Tick()Sebastian Huber2013-06-141-1/+1
| | | | | Delete _Scheduler_priority_Tick(). Use _SMP_Get_processor_count() for default tick operation. Delete _Scheduler_simple_smp_Tick().
* scheduler: Add start idle thread operationSebastian Huber2013-06-141-1/+2
| | | | Add and use _Scheduler_Start_idle().
* cpukit: Doxygen group fixes and many warnings addressedJoel Sherrill2013-01-101-5/+3
| | | | | | | The output of the modules.html is much improved. Most filesystem and POSIX API related groups are properly nested. Some formatting issues were addressed as were multiple inconsistencies.
* score: Doxygen Clean Up Task #2Mathew Kallada2012-12-281-32/+37
|
* score misc: Score misc: Clean up Doxygen #10 (GCI 2012)Christopher Kerl2012-12-011-7/+9
| | | | | | | This patch is a task from GCI 2012 which improves the Doxygen comments in the RTEMS source. http://www.google-melange.com/gci/task/view/google/gci2012/7983216
* score misc: Score misc: Clean up Doxygen #6 (GCI 2012)Christopher Kerl2012-11-291-2/+6
| | | | | | | This patch is a task from GCI 2012 which improves the Doxygen comments in the RTEMS source. http://www.google-melange.com/gci/task/view/google/gci2012/7976215
* score misc: Score misc: Clean up Doxygen #5Alex Ivanov2012-11-291-2/+2
|
* score misc: Clean up Doxygen #2 (GCI 2012)Christopher Kerl2012-11-281-0/+2
| | | | | | | This patch is a task from GCI 2012 which improves the Doxygen comments in the RTEMS source. http://www.google-melange.com/gci/task/view/google/gci2012/7986213
* PR2069: [CBS Scheduler] Memory leak and enqueue problemAndreas Heinig2012-08-061-1/+12
| | | | | | | Due to the fact that CBS extends the EDF scheduler, most parts of EDF are reused. One part is the allocation of the per-thread data. However, the CBS per-thread structure defines a further element (while including the rest of Scheduler_EDF_Per_thread)
* Remove All CVS Id Strings Possible Using a ScriptJoel Sherrill2012-05-111-2/+0
| | | | | | | | | | | | Script does what is expected and tries to do it as smartly as possible. + remove occurrences of two blank comment lines next to each other after Id string line removed. + remove entire comment blocks which only exited to contain CVS Ids + If the processing left a blank line at the top of a file, it was removed.
* 2011-10-04 Sebastian Huber <sebastian.huber@embedded-brains.de>Jennifer Averett2011-10-041-1/+1
| | | | | | PR 1922 * score/include/rtems/score/schedulercbs.h, score/src/schedulercbs.c: EDF and CBS scheduler: extern declarations fix.
* 2011-09-15 Petr Benes <benesp16@fel.cvut.cz>Joel Sherrill2011-09-151-0/+327
PR 1906/cpukit * sapi/Makefile.am, sapi/preinstall.am, sapi/include/confdefs.h, score/Makefile.am, score/preinstall.am: Add the CBS (Constant Bandwidth Server) scheduler. This is a complex scheduling policy built atop of the EDF scheduler. Unlike other schedulers, this one provides a user API and handles not only deadlines of tasks but also claimed budget per period. The main aim of the scheduler is isolation of tasks so that each task is guaranteed to meet all deadlines regardless of how other tasks behave. * sapi/include/rtems/cbs.h, sapi/inline/rtems/cbs.inl, score/include/rtems/score/schedulercbs.h, score/src/schedulercbs.c, score/src/schedulercbsattachthread.c, score/src/schedulercbscleanup.c, score/src/schedulercbscreateserver.c, score/src/schedulercbsdestroyserver.c, score/src/schedulercbsdetachthread.c, score/src/schedulercbsgetapprovedbudget.c, score/src/schedulercbsgetexecutiontime.c, score/src/schedulercbsgetparameters.c, score/src/schedulercbsgetremainingbudget.c, score/src/schedulercbsgetserverid.c, score/src/schedulercbsreleasejob.c, score/src/schedulercbssetparameters.c, score/src/schedulercbsunblock.c: New files.