RTEMS
|
SMP Scheduler. More...
Modules | |
EDF Priority SMP Scheduler | |
EDF Priority SMP Scheduler. | |
Files | |
file | schedulersmp.h |
SMP Scheduler API. | |
file | schedulersmpimpl.h |
SMP Scheduler Implementation. | |
Classes | |
struct | Scheduler_SMP_Context |
Scheduler context specialization for SMP schedulers. More... | |
struct | Scheduler_SMP_Node |
Scheduler node specialization for SMP schedulers. More... | |
Typedefs | |
typedef bool(* | Scheduler_SMP_Has_ready) (Scheduler_Context *context) |
typedef Scheduler_Node *(* | Scheduler_SMP_Get_highest_ready) (Scheduler_Context *context, Scheduler_Node *node) |
typedef Scheduler_Node *(* | Scheduler_SMP_Get_lowest_scheduled) (Scheduler_Context *context, Scheduler_Node *filter) |
typedef void(* | Scheduler_SMP_Extract) (Scheduler_Context *context, Scheduler_Node *node_to_extract) |
typedef void(* | Scheduler_SMP_Insert) (Scheduler_Context *context, Scheduler_Node *node_to_insert, Priority_Control insert_priority) |
typedef void(* | Scheduler_SMP_Move) (Scheduler_Context *context, Scheduler_Node *node_to_move) |
typedef bool(* | Scheduler_SMP_Ask_for_help) (Scheduler_Context *context, Thread_Control *thread, Scheduler_Node *node) |
typedef void(* | Scheduler_SMP_Update) (Scheduler_Context *context, Scheduler_Node *node_to_update, Priority_Control new_priority) |
typedef void(* | Scheduler_SMP_Set_affinity) (Scheduler_Context *context, Scheduler_Node *node, void *arg) |
typedef bool(* | Scheduler_SMP_Enqueue) (Scheduler_Context *context, Scheduler_Node *node_to_enqueue, Priority_Control priority) |
typedef void(* | Scheduler_SMP_Allocate_processor) (Scheduler_Context *context, Scheduler_Node *scheduled, Scheduler_Node *victim, Per_CPU_Control *victim_cpu) |
typedef void(* | Scheduler_SMP_Register_idle) (Scheduler_Context *context, Scheduler_Node *idle, Per_CPU_Control *cpu) |
Enumerations | |
enum | Scheduler_SMP_Node_state { SCHEDULER_SMP_NODE_BLOCKED, SCHEDULER_SMP_NODE_SCHEDULED, SCHEDULER_SMP_NODE_READY } |
SMP scheduler node states. More... | |
Functions | |
void | _Scheduler_SMP_Start_idle (const Scheduler_Control *scheduler, Thread_Control *idle, struct Per_CPU_Control *cpu) |
Starts an idle thread on the specified cpu. More... | |
static void | _Scheduler_SMP_Do_nothing_register_idle (Scheduler_Context *context, Scheduler_Node *idle, Per_CPU_Control *cpu) |
Does nothing. More... | |
static bool | _Scheduler_SMP_Priority_less_equal (const void *to_insert, const Chain_Node *next) |
Checks if to_insert is less or equal than the priority of the chain node. More... | |
static Scheduler_SMP_Context * | _Scheduler_SMP_Get_self (Scheduler_Context *context) |
Gets the scheduler smp context. More... | |
static void | _Scheduler_SMP_Initialize (Scheduler_SMP_Context *self) |
Initializes the scheduler smp context. More... | |
static Scheduler_SMP_Node * | _Scheduler_SMP_Thread_get_node (Thread_Control *thread) |
Gets the scheduler smp node of the thread. More... | |
static Scheduler_SMP_Node * | _Scheduler_SMP_Thread_get_own_node (Thread_Control *thread) |
Gets the scheduler smp node of the thread. More... | |
static Scheduler_SMP_Node * | _Scheduler_SMP_Node_downcast (Scheduler_Node *node) |
Gets the scheduler smp node. More... | |
static Scheduler_SMP_Node_state | _Scheduler_SMP_Node_state (const Scheduler_Node *node) |
Gets the state of the node. More... | |
static Priority_Control | _Scheduler_SMP_Node_priority (const Scheduler_Node *node) |
Gets the priority of the node. More... | |
static void | _Scheduler_SMP_Node_initialize (const Scheduler_Control *scheduler, Scheduler_SMP_Node *node, Thread_Control *thread, Priority_Control priority) |
Initializes the scheduler smp node. More... | |
static void | _Scheduler_SMP_Node_update_priority (Scheduler_SMP_Node *node, Priority_Control new_priority) |
Updates the priority of the node to the new priority. More... | |
static void | _Scheduler_SMP_Node_change_state (Scheduler_Node *node, Scheduler_SMP_Node_state new_state) |
Changes the state of the node to the given state. More... | |
static bool | _Scheduler_SMP_Is_processor_owned_by_us (const Scheduler_Context *context, const Per_CPU_Control *cpu) |
Checks if the processor is owned by the given context. More... | |
static Thread_Control * | _Scheduler_SMP_Get_idle_thread (Scheduler_Context *context) |
Gets The first idle thread of the given context. More... | |
static void | _Scheduler_SMP_Release_idle_thread (Scheduler_Context *context, Thread_Control *idle) |
Releases the thread and adds it to the idle threads. More... | |
static void | _Scheduler_SMP_Exctract_idle_thread (Thread_Control *idle) |
Extracts the node of the idle thread. More... | |
static void | _Scheduler_SMP_Allocate_processor_lazy (Scheduler_Context *context, Scheduler_Node *scheduled, Scheduler_Node *victim, Per_CPU_Control *victim_cpu) |
Allocates the cpu for the scheduled thread. More... | |
static void | _Scheduler_SMP_Allocate_processor_exact (Scheduler_Context *context, Scheduler_Node *scheduled, Scheduler_Node *victim, Per_CPU_Control *victim_cpu) |
Allocates the cpu for the scheduled thread. More... | |
static void | _Scheduler_SMP_Allocate_processor (Scheduler_Context *context, Scheduler_Node *scheduled, Scheduler_Node *victim, Per_CPU_Control *victim_cpu, Scheduler_SMP_Allocate_processor allocate_processor) |
Allocates the cpu for the scheduled thread using the given allocation function. More... | |
static Thread_Control * | _Scheduler_SMP_Preempt (Scheduler_Context *context, Scheduler_Node *scheduled, Scheduler_Node *victim, Scheduler_SMP_Allocate_processor allocate_processor) |
Preempts the victim's thread and allocates a cpu for the scheduled thread. More... | |
static Scheduler_Node * | _Scheduler_SMP_Get_lowest_scheduled (Scheduler_Context *context, Scheduler_Node *filter) |
Returns the lowest member of the scheduled nodes. More... | |
static void | _Scheduler_SMP_Enqueue_to_scheduled (Scheduler_Context *context, Scheduler_Node *node, Priority_Control priority, Scheduler_Node *lowest_scheduled, Scheduler_SMP_Insert insert_scheduled, Scheduler_SMP_Move move_from_scheduled_to_ready, Scheduler_SMP_Allocate_processor allocate_processor) |
Tries to schedule the given node. More... | |
static bool | _Scheduler_SMP_Enqueue (Scheduler_Context *context, Scheduler_Node *node, Priority_Control insert_priority, Chain_Node_order order, Scheduler_SMP_Insert insert_ready, Scheduler_SMP_Insert insert_scheduled, Scheduler_SMP_Move move_from_scheduled_to_ready, Scheduler_SMP_Get_lowest_scheduled get_lowest_scheduled, Scheduler_SMP_Allocate_processor allocate_processor) |
Enqueues a node according to the specified order function. More... | |
static bool | _Scheduler_SMP_Enqueue_scheduled (Scheduler_Context *context, Scheduler_Node *const node, Priority_Control insert_priority, Chain_Node_order order, Scheduler_SMP_Extract extract_from_ready, Scheduler_SMP_Get_highest_ready get_highest_ready, Scheduler_SMP_Insert insert_ready, Scheduler_SMP_Insert insert_scheduled, Scheduler_SMP_Move move_from_ready_to_scheduled, Scheduler_SMP_Allocate_processor allocate_processor) |
Enqueues a scheduled node according to the specified order function. More... | |
static void | _Scheduler_SMP_Extract_from_scheduled (Scheduler_Context *context, Scheduler_Node *node) |
Extracts a scheduled node from the scheduled nodes. More... | |
static void | _Scheduler_SMP_Schedule_highest_ready (Scheduler_Context *context, Scheduler_Node *victim, Per_CPU_Control *victim_cpu, Scheduler_SMP_Extract extract_from_ready, Scheduler_SMP_Get_highest_ready get_highest_ready, Scheduler_SMP_Move move_from_ready_to_scheduled, Scheduler_SMP_Allocate_processor allocate_processor) |
Schedules the highest ready node. More... | |
static void | _Scheduler_SMP_Preempt_and_schedule_highest_ready (Scheduler_Context *context, Scheduler_Node *victim, Per_CPU_Control *victim_cpu, Scheduler_SMP_Extract extract_from_ready, Scheduler_SMP_Get_highest_ready get_highest_ready, Scheduler_SMP_Move move_from_ready_to_scheduled, Scheduler_SMP_Allocate_processor allocate_processor) |
Schedules the highest ready node and preempts a currently executing one. More... | |
static void | _Scheduler_SMP_Block (Scheduler_Context *context, Thread_Control *thread, Scheduler_Node *node, Scheduler_SMP_Extract extract_from_scheduled, Scheduler_SMP_Extract extract_from_ready, Scheduler_SMP_Get_highest_ready get_highest_ready, Scheduler_SMP_Move move_from_ready_to_scheduled, Scheduler_SMP_Allocate_processor allocate_processor) |
Blocks the thread. More... | |
static void | _Scheduler_SMP_Unblock (Scheduler_Context *context, Thread_Control *thread, Scheduler_Node *node, Scheduler_SMP_Update update, Scheduler_SMP_Enqueue enqueue) |
Unblocks the thread. More... | |
static void | _Scheduler_SMP_Update_priority (Scheduler_Context *context, Thread_Control *thread, Scheduler_Node *node, Scheduler_SMP_Extract extract_from_ready, Scheduler_SMP_Update update, Scheduler_SMP_Enqueue enqueue, Scheduler_SMP_Enqueue enqueue_scheduled, Scheduler_SMP_Ask_for_help ask_for_help) |
Updates the priority of the node and the position in the queues it is in. More... | |
static void | _Scheduler_SMP_Yield (Scheduler_Context *context, Thread_Control *thread, Scheduler_Node *node, Scheduler_SMP_Extract extract_from_ready, Scheduler_SMP_Enqueue enqueue, Scheduler_SMP_Enqueue enqueue_scheduled) |
Performs a yield and asks for help if necessary. More... | |
static void | _Scheduler_SMP_Insert_scheduled (Scheduler_Context *context, Scheduler_Node *node_to_insert, Priority_Control priority_to_insert) |
Inserts the node with the given priority into the scheduled nodes. More... | |
static bool | _Scheduler_SMP_Ask_for_help (Scheduler_Context *context, Thread_Control *thread, Scheduler_Node *node, Chain_Node_order order, Scheduler_SMP_Insert insert_ready, Scheduler_SMP_Insert insert_scheduled, Scheduler_SMP_Move move_from_scheduled_to_ready, Scheduler_SMP_Get_lowest_scheduled get_lowest_scheduled, Scheduler_SMP_Allocate_processor allocate_processor) |
Asks for help. More... | |
static void | _Scheduler_SMP_Reconsider_help_request (Scheduler_Context *context, Thread_Control *thread, Scheduler_Node *node, Scheduler_SMP_Extract extract_from_ready) |
Reconsiders help request. More... | |
static void | _Scheduler_SMP_Withdraw_node (Scheduler_Context *context, Thread_Control *thread, Scheduler_Node *node, Thread_Scheduler_state next_state, Scheduler_SMP_Extract extract_from_ready, Scheduler_SMP_Get_highest_ready get_highest_ready, Scheduler_SMP_Move move_from_ready_to_scheduled, Scheduler_SMP_Allocate_processor allocate_processor) |
Withdraws the node. More... | |
static void | _Scheduler_SMP_Do_start_idle (Scheduler_Context *context, Thread_Control *idle, Per_CPU_Control *cpu, Scheduler_SMP_Register_idle register_idle) |
Starts the idle thread on the given processor. More... | |
static void | _Scheduler_SMP_Add_processor (Scheduler_Context *context, Thread_Control *idle, Scheduler_SMP_Has_ready has_ready, Scheduler_SMP_Enqueue enqueue_scheduled, Scheduler_SMP_Register_idle register_idle) |
Adds the idle thread to the processor. More... | |
static Thread_Control * | _Scheduler_SMP_Remove_processor (Scheduler_Context *context, Per_CPU_Control *cpu, Scheduler_SMP_Extract extract_from_ready, Scheduler_SMP_Enqueue enqueue) |
Removes an idle thread from the processor. More... | |
static void | _Scheduler_SMP_Set_affinity (Scheduler_Context *context, Thread_Control *thread, Scheduler_Node *node, void *arg, Scheduler_SMP_Set_affinity set_affinity, Scheduler_SMP_Extract extract_from_ready, Scheduler_SMP_Get_highest_ready get_highest_ready, Scheduler_SMP_Move move_from_ready_to_scheduled, Scheduler_SMP_Enqueue enqueue, Scheduler_SMP_Allocate_processor allocate_processor) |
Sets the affinity of the node. More... | |
SMP Scheduler.
The scheduler nodes can be in four states
State transitions are triggered via basic operations
During system initialization each processor of the scheduler instance starts with an idle thread assigned to it. Lets have a look at an example with two idle threads I and J with priority 5. We also have blocked threads A, B and C with priorities 1, 2 and 3 respectively. The scheduler nodes are ordered with respect to the thread priority from left to right in the below diagrams. The highest priority node (lowest priority number) is the leftmost node. Since the processor assignment is independent of the thread priority the processor indices may move from one state to the other.
Lets start A. For this an enqueue operation is performed.
Lets start C.
Lets start B.
Lets change the priority of thread A to 4.
Now perform a blocking operation with thread B. Please note that thread A migrated now from processor 0 to processor 1 and thread C still executes on processor 1.
SMP scheduler node states.
Definition at line 70 of file schedulersmp.h.
|
inlinestatic |
Adds the idle thread to the processor.
context | The scheduler context instance. | |
[in,out] | idle | The idle thread to add to the processor. |
has_ready | Function that checks if a given context has ready threads. | |
enqueue_scheduled | Function to enqueue a scheduled node. | |
register_idle | Function to register the idle thread for a cpu. |
Definition at line 1674 of file schedulersmpimpl.h.
|
inlinestatic |
Allocates the cpu for the scheduled thread using the given allocation function.
context | The scheduler context instance. | |
scheduled | The scheduled node that should be executed next. | |
victim | If the heir is this node's thread, no processor is allocated. | |
[in,out] | victim_cpu | The cpu to allocate. |
allocate_processor | The function to use for the allocation of victim_cpu. |
Definition at line 685 of file schedulersmpimpl.h.
|
inlinestatic |
Allocates the cpu for the scheduled thread.
This method is slightly different from _Scheduler_SMP_Allocate_processor_lazy() in that it does what it is asked to do. _Scheduler_SMP_Allocate_processor_lazy() attempts to prevent migrations but does not take into account affinity.
context | This parameter is unused. | |
scheduled | The scheduled node whose thread should be executed next. | |
victim | This parameter is unused. | |
[in,out] | victim_cpu | The cpu to allocate. |
Definition at line 659 of file schedulersmpimpl.h.
|
inlinestatic |
Allocates the cpu for the scheduled thread.
Attempts to prevent migrations but does not take into account affinity.
context | The scheduler context instance. | |
scheduled | The scheduled node that should be executed next. | |
victim | If the heir is this node's thread, no processor is allocated. | |
[in,out] | victim_cpu | The cpu to allocate. |
Definition at line 609 of file schedulersmpimpl.h.
|
inlinestatic |
Asks for help.
context | The scheduler instance context. | |
thread | The thread that asks for help. | |
[in,out] | node | The node of the thread that performs the ask for help operation. |
order | The order function. | |
insert_ready | Function to insert a node into the set of ready nodes. | |
insert_scheduled | Function to insert a node into the set of scheduled nodes. | |
move_from_scheduled_to_ready | Function to move a node from the set of scheduled nodes to the set of ready nodes. | |
get_lowest_scheduled | Function to select the node from the scheduled nodes to replace. | |
allocate_processor | Function to allocate a processor to a node based on the rules of the scheduler. |
true | The ask for help operation was successful. |
false | The ask for help operation was not successful. |
Definition at line 1449 of file schedulersmpimpl.h.
|
inlinestatic |
Blocks the thread.
context | The scheduler instance context. | |
[in,out] | thread | The thread of the scheduling operation. |
[in,out] | node | The scheduler node of the thread to block. |
extract_from_scheduled | Function to extract a node from the set of scheduled nodes. | |
extract_from_ready | Function to extract a node from the set of ready nodes. | |
get_highest_ready | Function to get the highest ready node. | |
move_from_ready_to_scheduled | Function to move a node from the set of ready nodes to the set of scheduled nodes. | |
allocate_processor | Function to allocate a processor to a node based on the rules of the scheduler. |
Definition at line 1189 of file schedulersmpimpl.h.
|
inlinestatic |
Does nothing.
context | This parameter is unused. |
idle | This parameter is unused. |
cpu | This parameter is unused. |
Definition at line 352 of file schedulersmpimpl.h.
|
inlinestatic |
Starts the idle thread on the given processor.
context | The scheduler context instance. | |
[in,out] | idle | The idle thread to schedule. |
cpu | The processor for the idle thread. | |
register_idle | Function to register the idle thread for a cpu. |
Definition at line 1643 of file schedulersmpimpl.h.
|
inlinestatic |
Enqueues a node according to the specified order function.
The node must not be in the scheduled state.
context | The scheduler instance context. | |
[in,out] | node | The node to enqueue. |
priority | The node insert priority. | |
order | The order function. | |
insert_ready | Function to insert a node into the set of ready nodes. | |
insert_scheduled | Function to insert a node into the set of scheduled nodes. | |
move_from_scheduled_to_ready | Function to move a node from the set of scheduled nodes to the set of ready nodes. | |
get_lowest_scheduled | Function to select the node from the scheduled nodes to replace. It may not be possible to find one, in this case a pointer must be returned so that the order functions returns false if this pointer is passed as the second argument to the order function. | |
allocate_processor | Function to allocate a processor to a node based on the rules of the scheduler. |
Definition at line 875 of file schedulersmpimpl.h.
|
inlinestatic |
Enqueues a scheduled node according to the specified order function.
context | The scheduler instance context. | |
[in,out] | node | The node to enqueue. |
order | The order function. | |
extract_from_ready | Function to extract a node from the set of ready nodes. | |
get_highest_ready | Function to get the highest ready node. | |
insert_ready | Function to insert a node into the set of ready nodes. | |
insert_scheduled | Function to insert a node into the set of scheduled nodes. | |
move_from_ready_to_scheduled | Function to move a node from the set of ready nodes to the set of scheduled nodes. | |
allocate_processor | Function to allocate a processor to a node based on the rules of the scheduler. |
Definition at line 930 of file schedulersmpimpl.h.
|
inlinestatic |
Tries to schedule the given node.
Schedules the node, or blocks if that is necessary.
context | The scheduler context instance. | |
[in,out] | node | The node to insert into the scheduled nodes. |
priority | The priority of node. | |
[in,out] | lowest_scheduled | The lowest member of the scheduled nodes. |
insert_scheduled | Function to insert a node into the set of scheduled nodes. | |
move_from_scheduled_to_ready | Function to move a node from the set of scheduled nodes to the set of ready nodes. | |
allocate_processor | Function to allocate a processor to a node based on the rules of the scheduler. |
Definition at line 797 of file schedulersmpimpl.h.
|
inlinestatic |
Extracts the node of the idle thread.
[in,out] | idle | The thread to extract the node of. |
Definition at line 592 of file schedulersmpimpl.h.
|
inlinestatic |
Extracts a scheduled node from the scheduled nodes.
context | This parameter is unused. |
node | The node to extract from the chain it belongs to. |
Definition at line 1047 of file schedulersmpimpl.h.
|
inlinestatic |
Gets The first idle thread of the given context.
context | The scheduler context to get the first idle thread from. |
Definition at line 558 of file schedulersmpimpl.h.
|
inlinestatic |
Returns the lowest member of the scheduled nodes.
context | The scheduler context instance. |
filter | This parameter is unused. |
Definition at line 761 of file schedulersmpimpl.h.
|
inlinestatic |
Gets the scheduler smp context.
context | The context to cast to Scheduler_SMP_Context *. |
Definition at line 393 of file schedulersmpimpl.h.
|
inlinestatic |
Initializes the scheduler smp context.
[out] | self | The context to initialize. |
Definition at line 405 of file schedulersmpimpl.h.
|
inlinestatic |
Inserts the node with the given priority into the scheduled nodes.
context | The scheduler instance context. |
node_to_insert | The scheduled node to insert. |
priority_to_insert | The priority with which to insert the node. |
Definition at line 1409 of file schedulersmpimpl.h.
|
inlinestatic |
Checks if the processor is owned by the given context.
context | The context to check whether cpu is owned by it. |
cpu | The cpu to check whether it is owned by context. |
true | cpu is owned by context. |
false | cpu is not owned by context. |
Definition at line 543 of file schedulersmpimpl.h.
|
inlinestatic |
Changes the state of the node to the given state.
[out] | node | the node to change the state of. |
new_state | The new state for node. |
Definition at line 523 of file schedulersmpimpl.h.
|
inlinestatic |
Gets the scheduler smp node.
node | The node to cast to Scheduler_SMP_Node *. |
Definition at line 448 of file schedulersmpimpl.h.
|
inlinestatic |
Initializes the scheduler smp node.
scheduler | The scheduler instance. | |
[out] | node | The node to initialize. |
thread | The thread of the scheduler smp node. | |
priority | The priority to initialize node with. |
Definition at line 491 of file schedulersmpimpl.h.
|
inlinestatic |
Gets the priority of the node.
node | The node to get the priority of. |
Definition at line 476 of file schedulersmpimpl.h.
|
inlinestatic |
Gets the state of the node.
node | The node to get the state of. |
Definition at line 462 of file schedulersmpimpl.h.
|
inlinestatic |
Updates the priority of the node to the new priority.
[out] | node | The node to update the priority of. |
new_priority | The new priority for node. |
Definition at line 509 of file schedulersmpimpl.h.
|
inlinestatic |
Preempts the victim's thread and allocates a cpu for the scheduled thread.
context | The scheduler context instance. | |
scheduled | Node of the scheduled thread that is about to be executed. | |
[in,out] | victim | Node of the thread to preempt. |
allocate_processor | The function for allocation of a processor for the new thread. |
Definition at line 707 of file schedulersmpimpl.h.
|
inlinestatic |
Schedules the highest ready node and preempts a currently executing one.
context | The scheduler context instance. |
victim | The node of the thread that is repressed by the newly scheduled thread. |
victim_cpu | The cpu to allocate. |
extract_from_ready | Function to extract a node from the set of ready nodes. |
get_highest_ready | Function to get the highest ready node. |
move_from_ready_to_scheduled | Function to move a node from the set of ready nodes to the set of scheduled nodes. |
allocate_processor | Function to allocate a processor to a node based on the rules of the scheduler. |
Definition at line 1129 of file schedulersmpimpl.h.
|
inlinestatic |
Checks if to_insert is less or equal than the priority of the chain node.
to_insert | The priority to compare. |
next | The chain node to compare the priority of. |
true | to_insert is less or equal than the priority of next. |
false | to_insert is greater than the priority of next. |
Definition at line 372 of file schedulersmpimpl.h.
|
inlinestatic |
Reconsiders help request.
context | The scheduler context instance. | |
thread | The thread to reconsider the help request of. | |
[in,out] | node | The scheduler node of thread. |
extract_from_ready | Function to extract a node from the ready queue of the scheduler context. |
Definition at line 1552 of file schedulersmpimpl.h.
|
inlinestatic |
Releases the thread and adds it to the idle threads.
[in,out] | context | The scheduler context instance. |
idle | The thread to add to the idle threads. |
Definition at line 577 of file schedulersmpimpl.h.
|
inlinestatic |
Removes an idle thread from the processor.
context | The scheduler context instance. |
cpu | The processor to remove from. |
extract_from_ready | Function to extract a node from the ready queue of the scheduler context. |
enqueue | Function to enqueue a node with a given priority. |
Definition at line 1714 of file schedulersmpimpl.h.
|
inlinestatic |
Schedules the highest ready node.
context | The scheduler context instance. |
victim | The node of the thread that is repressed by the newly scheduled thread. |
victim_cpu | The cpu to allocate. |
extract_from_ready | Function to extract a node from the set of ready nodes. |
get_highest_ready | Function to get the highest ready node. |
move_from_ready_to_scheduled | Function to move a node from the set of ready nodes to the set of scheduled nodes. |
allocate_processor | Function to allocate a processor to a node based on the rules of the scheduler. |
Definition at line 1070 of file schedulersmpimpl.h.
|
inlinestatic |
Sets the affinity of the node.
Also performs a reinsert into the queue the node is currently in.
context | The scheduler context instance. | |
thread | The thread for the operation. | |
[in,out] | node | The node to set the affinity of. |
arg | The affinity for node. | |
set_affinity | Function to set the affinity of a node. | |
extract_from_ready | Function to extract a node from the ready queue of the scheduler context. | |
get_highest_ready | Function to get the highest ready node. | |
move_from_ready_to_scheduled | Function to move a node from the set of ready nodes to the set of scheduled nodes. | |
enqueue | Function to enqueue a node with a given priority. | |
allocate_processor | Function to allocate a processor to a node based on the rules of the scheduler. |
Definition at line 1795 of file schedulersmpimpl.h.
void _Scheduler_SMP_Start_idle | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | idle, | ||
struct Per_CPU_Control * | cpu | ||
) |
Starts an idle thread on the specified cpu.
scheduler | The scheduler instance. | |
[in,out] | idle | The idle thread to schedule. |
[out] | cpu | The cpu to run the idle thread on. |
Definition at line 15 of file schedulersmpstartidle.c.
|
inlinestatic |
Gets the scheduler smp node of the thread.
thread | The thread to get the smp node of. |
Definition at line 420 of file schedulersmpimpl.h.
|
inlinestatic |
Gets the scheduler smp node of the thread.
thread | The thread to get the smp node of. |
Definition at line 434 of file schedulersmpimpl.h.
|
inlinestatic |
Unblocks the thread.
context | The scheduler instance context. | |
[in,out] | thread | The thread of the scheduling operation. |
[in,out] | node | The scheduler node of the thread to block. |
update | Function to update the node's priority to the new value. | |
enqueue | Function to insert a node with a priority in the ready queue of a context. |
Definition at line 1243 of file schedulersmpimpl.h.
|
inlinestatic |
Updates the priority of the node and the position in the queues it is in.
This function firstly updates the priority of the node and then extracts and reinserts it into the queue the node is part of using the given functions.
context | The scheduler instance context. | |
thread | The thread for the operation. | |
[in,out] | node | The node to update the priority of. |
extract_from_ready | Function to extract a node from the ready queue of the scheduler context. | |
update | Function to update the priority of a node in the scheduler context. | |
enqueue | Function to enqueue a node with a given priority. | |
enqueue_scheduled | Function to enqueue a scheduled node. | |
ask_for_help | Function to perform a help request. |
Definition at line 1312 of file schedulersmpimpl.h.
|
inlinestatic |
Withdraws the node.
context | The scheduler context instance. | |
[in,out] | thread | The thread to change to next_state. |
[in,out] | node | The node to withdraw. |
next_state | The new state for thread. | |
extract_from_ready | Function to extract a node from the ready queue of the scheduler context. | |
get_highest_ready | Function to get the highest ready node. | |
move_from_ready_to_scheduled | Function to move a node from the set of ready nodes to the set of scheduled nodes. | |
allocate_processor | Function to allocate a processor to a node based on the rules of the scheduler. |
Definition at line 1590 of file schedulersmpimpl.h.
|
inlinestatic |
Performs a yield and asks for help if necessary.
context | The scheduler instance context. |
thread | The thread for the operation. |
node | The node of the thread that yields. |
extract_from_ready | Function to extract a node from the ready queue of the scheduler context. |
enqueue | Function to enqueue a node with a given priority. |
enqueue_scheduled | Function to enqueue a scheduled node. |
Definition at line 1368 of file schedulersmpimpl.h.