![]() |
RTEMS 6.3
|
This group contains the Scheduler Handler implementation. More...
Topics | |
| Constant Bandwidth Server (CBS) Scheduler | |
| This group contains the Constant Bandwidth Server (CBS) Scheduler implementation. | |
| Deterministic Priority Scheduler | |
| This group contains the Deterministic Priority Scheduler implementation. | |
| EDF Scheduler | |
| This group contains the EDF Scheduler implementation. | |
| SMP Scheduler | |
| This group contains the SMP Scheduler implementation. | |
| Simple Priority Scheduler | |
| This group contains the Simple Priority Scheduler implementation. | |
Files | |
| file | cpukit/include/rtems/score/scheduler.h |
| This header file provides interfaces of the Scheduler Handler which are used by the implementation and the Application Configuration. | |
| file | cpukit/include/rtems/score/schedulerimpl.h |
| This header file provides interfaces of the Scheduler Handler which are only used by the implementation. | |
| file | cpukit/include/rtems/score/schedulernode.h |
| This header file provides interfaces of the Scheduler Handler related to scheduler nodes which are used by the implementation and the Application Configuration. | |
| file | cpukit/include/rtems/score/schedulernodeimpl.h |
| This header file provides interfaces of the Scheduler Handler related to scheduler nodes which are only used by the implementation. | |
| file | cpukit/include/rtems/score/scheduleruniimpl.h |
| This header file provides interfaces of the supporting the implementation of uniprocessor schedulers. | |
| file | cpukit/score/src/sched.c |
| This source file contains the implementation of _Sched_Count(), _Sched_Index(), _Sched_Name_to_index(), and _Sched_Processor_count(). | |
| file | cpukit/score/src/scheduler.c |
| This source file contains the implementation of _Scheduler_Handler_initialization(). | |
| file | cpukit/score/src/schedulerdefaultmakecleansticky.c |
| This source file contains the implementation of _Scheduler_default_Sticky_do_nothing(). | |
| file | cpukit/score/src/schedulerdefaultmappriority.c |
| This source file contains the implementation of _Scheduler_default_Map_priority() and _Scheduler_default_Unmap_priority(). | |
| file | cpukit/score/src/schedulerdefaultnodedestroy.c |
| This source file contains the implementation of _Scheduler_default_Node_destroy(). | |
| file | cpukit/score/src/schedulerdefaultnodeinit.c |
| This source file contains the implementation of _Scheduler_default_Node_initialize(). | |
| file | cpukit/score/src/schedulerdefaultpinunpin.c |
| This source file contains the implementation of _Scheduler_default_Pin_or_unpin_not_supported(). | |
| file | cpukit/score/src/schedulerdefaultpinunpindonothing.c |
| This source file contains the implementation of _Scheduler_default_Pin_or_unpin_do_nothing(). | |
| file | cpukit/score/src/schedulerdefaultreleasejob.c |
| This source file contains the implementation of _Scheduler_default_Release_job() and _Scheduler_default_Cancel_job(). | |
| file | cpukit/score/src/schedulerdefaultschedule.c |
| This source file contains the implementation of _Scheduler_default_Schedule(). | |
| file | cpukit/score/src/schedulerdefaultsetaffinity.c |
| This source file contains the implementation of _Scheduler_default_Set_affinity(). | |
| file | cpukit/score/src/schedulerdefaultstartidle.c |
| This source file contains the implementation of _Scheduler_default_Start_idle(). | |
| file | cpukit/score/src/schedulergetaffinity.c |
| This source file contains the implementation of _Scheduler_Get_affinity(). | |
| file | cpukit/score/src/schedulersetaffinity.c |
| This source file contains the implementation of _Scheduler_Set_affinity(). | |
| file | cpukit/score/src/schedulersmp.c |
| This source file contains the implementation of _Scheduler_Request_ask_for_help(). | |
| file | cpukit/score/src/schedulersmpstartidle.c |
| This source file contains the implementation of _Scheduler_SMP_Start_idle(). | |
Data Structures | |
| struct | Scheduler_Operations |
| The scheduler operations. More... | |
| struct | Scheduler_Context |
| Scheduler context. More... | |
| struct | _Scheduler_Control |
| Scheduler control. More... | |
| struct | Scheduler_Node |
| Scheduler node for per-thread data. More... | |
| struct | Scheduler_Node::[struct].Wait |
| Thread wait support block. More... | |
| struct | Scheduler_Node::[struct].Priority |
| The thread priority information used by the scheduler. More... | |
Macros | |
| #define | _Scheduler_Count ( (size_t) 1 ) |
| This constant contains the count of configured schedulers. | |
| #define | SCHEDULER_DEFAULT_SMP_OPERATIONS |
| This define provides a set of default implementations for SMP-specific scheduler operations. | |
| #define | SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION |
| This define provides the default implementation for the SMP-specific set affinity operation. | |
| #define | PRIORITY_MAXIMUM ( _Scheduler_Table[ 0 ].maximum_priority ) |
| This defines the lowest (least important) thread priority of the first scheduler instance. | |
| #define | SCHEDULER_NODE_OF_WAIT_PRIORITY_NODE(node) |
| #define | SCHEDULER_NODE_OF_WAIT_PRIORITY(node) |
| #define | SCHEDULER_PRIORITY_MAP(priority) |
| Maps a priority value to support the append indicator. | |
| #define | SCHEDULER_PRIORITY_UNMAP(priority) |
| Returns the plain priority value. | |
| #define | SCHEDULER_PRIORITY_PURIFY(priority) |
| Clears the priority append indicator bit. | |
| #define | SCHEDULER_PRIORITY_APPEND(priority) |
| Returns the priority control with the append indicator bit set. | |
| #define | SCHEDULER_PRIORITY_IS_APPEND(priority) |
| Returns true, if the item should be appended to its priority group, otherwise returns false and the item should be prepended to its priority group. | |
Typedefs | |
| typedef struct _Scheduler_Control | Scheduler_Control |
| typedef struct Scheduler_Context | Scheduler_Context |
| Scheduler context. | |
| typedef struct Scheduler_Node | Scheduler_Node |
Functions | |
| Priority_Control | _Scheduler_default_Map_priority (const Scheduler_Control *scheduler, Priority_Control priority) |
| Returns the scheduler internal thread priority mapped by SCHEDULER_PRIORITY_MAP(). | |
| Priority_Control | _Scheduler_default_Unmap_priority (const Scheduler_Control *scheduler, Priority_Control priority) |
| Returns the user visible thread priority unmapped by SCHEDULER_PRIORITY_UNMAP(). | |
| void | _Scheduler_default_Schedule (const Scheduler_Control *scheduler, Thread_Control *the_thread) |
| Does nothing. | |
| void | _Scheduler_default_Node_initialize (const Scheduler_Control *scheduler, Scheduler_Node *node, Thread_Control *the_thread, Priority_Control priority) |
| Performs the scheduler base node initialization. | |
| void | _Scheduler_default_Node_destroy (const Scheduler_Control *scheduler, Scheduler_Node *node) |
| Does nothing. | |
| void | _Scheduler_default_Release_job (const Scheduler_Control *scheduler, Thread_Control *the_thread, Priority_Node *priority_node, uint64_t deadline, Thread_queue_Context *queue_context) |
| Does nothing. | |
| void | _Scheduler_default_Cancel_job (const Scheduler_Control *scheduler, Thread_Control *the_thread, Priority_Node *priority_node, Thread_queue_Context *queue_context) |
| Does nothing. | |
| void | _Scheduler_default_Start_idle (const Scheduler_Control *scheduler, Thread_Control *the_thread, struct Per_CPU_Control *cpu) |
| Starts an idle thread. | |
| void | _Scheduler_Handler_initialization (void) |
| Initializes the scheduler to the policy chosen by the user. | |
| Status_Control | _Scheduler_Get_affinity (Thread_Control *the_thread, size_t cpusetsize, cpu_set_t *cpuset) |
| Copies the thread's scheduler's affinity to the given cpuset. | |
| Status_Control | _Scheduler_Set_affinity (Thread_Control *the_thread, size_t cpusetsize, const cpu_set_t *cpuset) |
| Sets the thread's scheduler's affinity. | |
Variables | |
| const Scheduler_Control | _Scheduler_Table [] |
| This table contains the configured schedulers. | |
This group contains the Scheduler Handler implementation.
This handler encapsulates functionality related to managing sets of threads that are ready for execution.
Schedulers are used by the system to manage sets of threads that are ready for execution. A scheduler consists of
Each thread uses exactly one scheduler as its home scheduler. Threads may temporarily use another scheduler due to actions of locking protocols.
All properties of a scheduler can be configured and controlled by the user. Some properties are fixed at link time (defined by application configuration options), other properties can be changed at runtime through directive calls.
The scheduler index, name, and initial processor set are defined for a particular application by the application configuration. The schedulers are registered in the _Scheduler_Table which has _Scheduler_Count entries.
| #define _Scheduler_Count ( (size_t) 1 ) |
This constant contains the count of configured schedulers.
In SMP configurations, the constant is defined by <rtems/confdefs.h> through the count of entries of the CONFIGURE_SCHEDULER_TABLE_ENTRIES application configuration option.
In uniprocessor configurations, this is a compile time constant set to one. This is important so that the compiler can optimize some loops away.
| #define SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION |
This define provides the default implementation for the SMP-specific set affinity operation.
The default implementation _Scheduler_default_Set_affinity() is intended for uniprocessor schedulers and SMP schedulers which only support an affinity to all online processors.
If SMP support is disabled, the define evaluates to nothing.
| #define SCHEDULER_DEFAULT_SMP_OPERATIONS |
This define provides a set of default implementations for SMP-specific scheduler operations.
The default implementations are intended for uniprocessor schedulers. SMP schedulers shall implement the operations properly.
If SMP support is disabled, the define evaluates to nothing.
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 are NULL, 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. The processor add operation is NULL, since there is no other processor to add. The processor remove operation is NULL, since the one and only processor cannot be removed.
| #define SCHEDULER_NODE_OF_WAIT_PRIORITY | ( | node | ) |
| #define SCHEDULER_NODE_OF_WAIT_PRIORITY_NODE | ( | node | ) |
| #define SCHEDULER_PRIORITY_APPEND | ( | priority | ) |
Returns the priority control with the append indicator bit set.
| #define SCHEDULER_PRIORITY_IS_APPEND | ( | priority | ) |
Returns true, if the item should be appended to its priority group, otherwise returns false and the item should be prepended to its priority group.
| #define SCHEDULER_PRIORITY_MAP | ( | priority | ) |
Maps a priority value to support the append indicator.
| #define SCHEDULER_PRIORITY_PURIFY | ( | priority | ) |
Clears the priority append indicator bit.
| #define SCHEDULER_PRIORITY_UNMAP | ( | priority | ) |
Returns the plain priority value.
| typedef struct Scheduler_Context Scheduler_Context |
Scheduler context.
The scheduler context of a particular scheduler implementation must place this structure at the begin of its context structure.
| void _Scheduler_default_Cancel_job | ( | const Scheduler_Control * | scheduler, |
| Thread_Control * | the_thread, | ||
| Priority_Node * | priority_node, | ||
| Thread_queue_Context * | queue_context ) |
Does nothing.
| scheduler | This parameter is unused. |
| the_thread | This parameter is unused. |
| priority_node | This parameter is unused. |
| queue_context | This parameter is unused. |
| Priority_Control _Scheduler_default_Map_priority | ( | const Scheduler_Control * | scheduler, |
| Priority_Control | priority ) |
Returns the scheduler internal thread priority mapped by SCHEDULER_PRIORITY_MAP().
| scheduler | Unused. |
| priority | The user visible thread priority. |
| void _Scheduler_default_Node_destroy | ( | const Scheduler_Control * | scheduler, |
| Scheduler_Node * | node ) |
Does nothing.
| scheduler | This parameter is unused. |
| node | This parameter is unused. |
| void _Scheduler_default_Node_initialize | ( | const Scheduler_Control * | scheduler, |
| Scheduler_Node * | node, | ||
| Thread_Control * | the_thread, | ||
| Priority_Control | priority ) |
Performs the scheduler base node initialization.
| scheduler | This parameter is unused. | |
| [out] | node | The node to initialize. |
| the_thread | This parameter is unused. | |
| priority | The thread priority. |
| void _Scheduler_default_Release_job | ( | const Scheduler_Control * | scheduler, |
| Thread_Control * | the_thread, | ||
| Priority_Node * | priority_node, | ||
| uint64_t | deadline, | ||
| Thread_queue_Context * | queue_context ) |
Does nothing.
| scheduler | This parameter is unused. |
| the_thread | This parameter is unused. |
| priority_node | This parameter is unused. |
| deadline | This parameter is unused. |
| queue_context | This parameter is unused. |
| void _Scheduler_default_Schedule | ( | const Scheduler_Control * | scheduler, |
| Thread_Control * | the_thread ) |
Does nothing.
| scheduler | This parameter is unused. |
| the_thread | This parameter is unused. |
| void _Scheduler_default_Start_idle | ( | const Scheduler_Control * | scheduler, |
| Thread_Control * | the_thread, | ||
| struct Per_CPU_Control * | cpu ) |
Starts an idle thread.
| scheduler | This parameter is unused. | |
| [in,out] | the_thread | An idle thread. |
| cpu | This parameter is unused. |
| Priority_Control _Scheduler_default_Unmap_priority | ( | const Scheduler_Control * | scheduler, |
| Priority_Control | priority ) |
Returns the user visible thread priority unmapped by SCHEDULER_PRIORITY_UNMAP().
| scheduler | Unused. |
| priority | The scheduler internal thread priority. |
| Status_Control _Scheduler_Get_affinity | ( | Thread_Control * | the_thread, |
| size_t | cpusetsize, | ||
| cpu_set_t * | cpuset ) |
Copies the thread's scheduler's affinity to the given cpuset.
| the_thread | The thread to get the affinity of its scheduler. | |
| cpusetsize | The size of cpuset. | |
| [out] | cpuset | The cpuset that serves as destination for the copy operation |
| STATUS_SUCCESSFUL | The operation succeeded. |
| STATUS_INVALID_SIZE | The processor set was too small. |
| void _Scheduler_Handler_initialization | ( | void | ) |
Initializes the scheduler to the policy chosen by the user.
This routine initializes the scheduler to the policy chosen by the user through confdefs, or to the priority scheduler with ready chains by default.
| Status_Control _Scheduler_Set_affinity | ( | Thread_Control * | the_thread, |
| size_t | cpusetsize, | ||
| const cpu_set_t * | cpuset ) |
Sets the thread's scheduler's affinity.
| [in,out] | the_thread | The thread to set the affinity of. |
| cpusetsize | The size of cpuset. | |
| cpuset | The cpuset to set the affinity. |
| STATUS_SUCCESSFUL | The operation succeeded. |
| STATUS_INVALID_NUMBER | The processor set was not a valid new processor affinity set for the thread. |
|
extern |
This table contains the configured schedulers.
The table is defined by <rtems/confdefs.h> through the CONFIGURE_SCHEDULER_TABLE_ENTRIES application configuration option.