RTEMS: Deterministic Priority Affinity SMP Scheduler

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
Files | Data Structures | Macros | Functions
Deterministic Priority Affinity SMP Scheduler
Internal » SuperCore » Scheduler Handler » SMP Scheduler » Deterministic Priority SMP Scheduler

Deterministic Priority Affinity SMP Scheduler. More...

## Files
file | schedulerpriorityaffinitysmp.h
| Deterministic Priority Affinity SMP Scheduler API.
file | schedulerpriorityaffinitysmp.c
| Deterministic Priority Affinity SMP Scheduler Implementation.

## Data Structures
struct | Scheduler_priority_affinity_SMP_Node
| Scheduler node specialization for Deterministic Priority Affinity SMP schedulers. More...

## Macros
#define | SCHEDULER_PRIORITY_AFFINITY_SMP_ENTRY_POINTS
| Entry points for the Deterministic Priority Affinity SMP Scheduler.

## Functions
void | _Scheduler_priority_affinity_SMP_Node_initialize (const Scheduler_Control *scheduler, Scheduler_Node *node, Thread_Control *the_thread, Priority_Control priority)
| Initializes per thread scheduler information.
void | _Scheduler_priority_affinity_SMP_Block (const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node)
| Blocks a thread.
void | _Scheduler_priority_affinity_SMP_Unblock (const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node)
| Unblocks a thread.
void | _Scheduler_priority_affinity_SMP_Update_priority (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
| Updates the priority of the node.
bool | _Scheduler_priority_affinity_SMP_Ask_for_help (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
| Asks for help.
void | _Scheduler_priority_affinity_SMP_Reconsider_help_request (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
| Reconsiders help.
void | _Scheduler_priority_affinity_SMP_Withdraw_node (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node, Thread_Scheduler_state next_state)
| Withdraws node.
void | _Scheduler_priority_affinity_SMP_Add_processor (const Scheduler_Control *scheduler, Thread_Control *idle)
| Adds idle to scheduler.
Thread_Control * | _Scheduler_priority_affinity_SMP_Remove_processor (const Scheduler_Control *scheduler, struct Per_CPU_Control *cpu)
| Removes an idle thread from the given cpu.
bool | _Scheduler_priority_affinity_SMP_Set_affinity (const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node, const Processor_mask *affinity)
| Sets affinity for the priority affinity SMP scheduler.

## Detailed Description

Deterministic Priority Affinity SMP Scheduler.

This is an extension of the Deterministic Priority SMP Scheduler. which is an implementation of the global fixed priority scheduler (G-FP). It adds thread to core affinity support.

Note
  This is the first iteration of this scheduler. It currently tracks the requested affinity to exercise the Scheduler Framework but it does not honor that affinity in assigning threads to cores. This will be added in a subsequent revision.

## Macro Definition Documentation

## ◆ SCHEDULER_PRIORITY_AFFINITY_SMP_ENTRY_POINTS

#define SCHEDULER_PRIORITY_AFFINITY_SMP_ENTRY_POINTS

Value:
{ \
_Scheduler_priority_SMP_Initialize, \
_Scheduler_default_Schedule, \
_Scheduler_priority_SMP_Yield, \
_Scheduler_priority_affinity_SMP_Block, \
_Scheduler_priority_affinity_SMP_Unblock, \
_Scheduler_priority_affinity_SMP_Update_priority, \
_Scheduler_default_Map_priority, \
_Scheduler_default_Unmap_priority, \
_Scheduler_priority_affinity_SMP_Ask_for_help, \
_Scheduler_priority_affinity_SMP_Reconsider_help_request, \
_Scheduler_priority_affinity_SMP_Withdraw_node, \
_Scheduler_default_Pin_or_unpin, \
_Scheduler_default_Pin_or_unpin, \
_Scheduler_priority_affinity_SMP_Add_processor, \
_Scheduler_priority_affinity_SMP_Remove_processor, \
_Scheduler_priority_affinity_SMP_Node_initialize, \
_Scheduler_default_Node_destroy, \
_Scheduler_default_Release_job, \
_Scheduler_default_Cancel_job, \
_Scheduler_default_Tick, \
_Scheduler_SMP_Start_idle, \
_Scheduler_priority_affinity_SMP_Set_affinity \
}
_Scheduler_priority_affinity_SMP_Remove_processor
Thread_Control * _Scheduler_priority_affinity_SMP_Remove_processor(const Scheduler_Control *scheduler, struct Per_CPU_Control *cpu)
Removes an idle thread from the given cpu.
Definition: schedulerpriorityaffinitysmp.c:519
_Scheduler_priority_affinity_SMP_Node_initialize
void _Scheduler_priority_affinity_SMP_Node_initialize(const Scheduler_Control *scheduler, Scheduler_Node *node, Thread_Control *the_thread, Priority_Control priority)
Initializes per thread scheduler information.
Definition: schedulerpriorityaffinitysmp.c:63
_Scheduler_priority_affinity_SMP_Withdraw_node
void _Scheduler_priority_affinity_SMP_Withdraw_node(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node, Thread_Scheduler_state next_state)
Withdraws node.
Definition: schedulerpriorityaffinitysmp.c:482
_Scheduler_priority_affinity_SMP_Add_processor
void _Scheduler_priority_affinity_SMP_Add_processor(const Scheduler_Control *scheduler, Thread_Control *idle)
Adds idle to scheduler.
Definition: schedulerpriorityaffinitysmp.c:503
_Scheduler_priority_affinity_SMP_Ask_for_help
bool _Scheduler_priority_affinity_SMP_Ask_for_help(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Asks for help.
Definition: schedulerpriorityaffinitysmp.c:455
_Scheduler_priority_affinity_SMP_Block
void _Scheduler_priority_affinity_SMP_Block(const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node)
Blocks a thread.
Definition: schedulerpriorityaffinitysmp.c:165
_Scheduler_priority_affinity_SMP_Set_affinity
bool _Scheduler_priority_affinity_SMP_Set_affinity(const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node, const Processor_mask *affinity)
Sets affinity for the priority affinity SMP scheduler.
Definition: schedulerpriorityaffinitysmp.c:534
_Scheduler_priority_affinity_SMP_Reconsider_help_request
void _Scheduler_priority_affinity_SMP_Reconsider_help_request(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Reconsiders help.
Definition: schedulerpriorityaffinitysmp.c:466
_Scheduler_priority_affinity_SMP_Update_priority
void _Scheduler_priority_affinity_SMP_Update_priority(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Updates the priority of the node.
Definition: schedulerpriorityaffinitysmp.c:430
_Scheduler_priority_affinity_SMP_Unblock
void _Scheduler_priority_affinity_SMP_Unblock(const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node)
Unblocks a thread.
Definition: schedulerpriorityaffinitysmp.c:341
_Scheduler_priority_SMP_Yield
void _Scheduler_priority_SMP_Yield(const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node)
Performs the yield of a thread.
Definition: schedulerprioritysmp.c:287
_Scheduler_priority_SMP_Initialize
void _Scheduler_priority_SMP_Initialize(const Scheduler_Control *scheduler)
Initializes the priority SMP scheduler.
Definition: schedulerprioritysmp.c:35
_Scheduler_SMP_Start_idle
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.
Definition: schedulersmpstartidle.c:15
_Scheduler_default_Tick
void _Scheduler_default_Tick(const Scheduler_Control *scheduler, Thread_Control *executing)
Performs tick operations depending on the CPU budget algorithm for each executing thread.
Definition: schedulerdefaulttick.c:27
_Scheduler_default_Release_job
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.
Definition: schedulerdefaultreleasejob.c:24
_Scheduler_default_Node_destroy
void _Scheduler_default_Node_destroy(const Scheduler_Control *scheduler, Scheduler_Node *node)
Does nothing.
Definition: schedulerdefaultnodedestroy.c:24
_Scheduler_default_Map_priority
Priority_Control _Scheduler_default_Map_priority(const Scheduler_Control *scheduler, Priority_Control priority)
Returns the scheduler internal thread priority mapped by SCHEDULER_PRIORITY_MAP().
Definition: schedulerdefaultmappriority.c:15
_Scheduler_default_Schedule
void _Scheduler_default_Schedule(const Scheduler_Control *scheduler, Thread_Control *the_thread)
Does nothing.
Definition: schedulerdefaultschedule.c:15
_Scheduler_default_Unmap_priority
Priority_Control _Scheduler_default_Unmap_priority(const Scheduler_Control *scheduler, Priority_Control priority)
Returns the user visible thread priority unmapped by SCHEDULER_PRIORITY_UNMAP().
Definition: schedulerdefaultmappriority.c:23
_Scheduler_default_Cancel_job
void _Scheduler_default_Cancel_job(const Scheduler_Control *scheduler, Thread_Control *the_thread, Priority_Node *priority_node, Thread_queue_Context *queue_context)
Does nothing.
Definition: schedulerdefaultreleasejob.c:39

Entry points for the Deterministic Priority Affinity SMP Scheduler.

## Function Documentation

## ◆ _Scheduler_priority_affinity_SMP_Add_processor()

void _Scheduler_priority_affinity_SMP_Add_processor | ( | const Scheduler_Control * | scheduler,
|  | Thread_Control * | idle
| ) |  |

Adds idle to scheduler.

Parameters

  [in,out] | scheduler | The scheduler instance to add the processor to.
  | idle | The idle thread control.

## ◆ _Scheduler_priority_affinity_SMP_Ask_for_help()

bool _Scheduler_priority_affinity_SMP_Ask_for_help | ( | const Scheduler_Control * | scheduler,
|  | Thread_Control * | the_thread,
|  | Scheduler_Node * | node
| ) |  |

Asks for help.

Parameters

  scheduler | The scheduler instance to ask for help.
  the_thread | The thread needing help.
  node | The scheduler node.

Return values

  true | Ask for help was successful.
  false | Ask for help was not successful.

## ◆ _Scheduler_priority_affinity_SMP_Block()

void _Scheduler_priority_affinity_SMP_Block | ( | const Scheduler_Control * | scheduler,
|  | Thread_Control * | thread,
|  | Scheduler_Node * | node
| ) |  |

Blocks a thread.

Parameters

  | scheduler | The scheduler instance.
  [in,out] | The | thread to block.
  [in,out] | node | The scheduler node of the thread.

## ◆ _Scheduler_priority_affinity_SMP_Node_initialize()

void _Scheduler_priority_affinity_SMP_Node_initialize | ( | const Scheduler_Control * | scheduler,
|  | Scheduler_Node * | node,
|  | Thread_Control * | the_thread,
|  | Priority_Control | priority
| ) |  |

Initializes per thread scheduler information.

This routine allocates thread->scheduler.

Parameters

  | scheduler | Points to the scheduler specific information.
  [in,out] | node | The node the scheduler is allocating management memory for.
  | the_thread | The thread of the node.
  | priority | The thread priority.

## ◆ _Scheduler_priority_affinity_SMP_Reconsider_help_request()

void _Scheduler_priority_affinity_SMP_Reconsider_help_request | ( | const Scheduler_Control * | scheduler,
|  | Thread_Control * | the_thread,
|  | Scheduler_Node * | node
| ) |  |

Reconsiders help.

Parameters

  scheduler | The scheduler instance to reconsider the help request.
  the_thread | The thread reconsidering a help request.
  node | The scheduler node.

## ◆ _Scheduler_priority_affinity_SMP_Remove_processor()

Thread_Control * _Scheduler_priority_affinity_SMP_Remove_processor | ( | const Scheduler_Control * | scheduler,
|  | struct Per_CPU_Control * | cpu
| ) |  |

Removes an idle thread from the given cpu.

Parameters

  scheduler | The scheduler instance.
  cpu | The cpu control to remove from scheduler.

Returns
  The idle thread of the processor.

## ◆ _Scheduler_priority_affinity_SMP_Set_affinity()

bool _Scheduler_priority_affinity_SMP_Set_affinity | ( | const Scheduler_Control * | scheduler,
|  | Thread_Control * | thread,
|  | Scheduler_Node * | node,
|  | const Processor_mask * | affinity
| ) |  |

Sets affinity for the priority affinity SMP scheduler.

Parameters

  | scheduler | The scheduler of the thread.
  [in,out] | thread | The associated thread.
  [in,out] | node | The scheduler node.
  | affinity | The new affinity set.

Return values

  true | if successful
  false | if unsuccessful

## ◆ _Scheduler_priority_affinity_SMP_Unblock()

void _Scheduler_priority_affinity_SMP_Unblock | ( | const Scheduler_Control * | scheduler,
|  | Thread_Control * | thread,
|  | Scheduler_Node * | node
| ) |  |

Unblocks a thread.

Parameters

  | scheduler | The scheduler instance.
  [in,out] | The | thread to unblock.
  [in,out] | node | The scheduler node of the thread.

## ◆ _Scheduler_priority_affinity_SMP_Update_priority()

void _Scheduler_priority_affinity_SMP_Update_priority | ( | const Scheduler_Control * | scheduler,
|  | Thread_Control * | the_thread,
|  | Scheduler_Node * | node
| ) |  |

Updates the priority of the node.

Parameters

  | scheduler | The scheduler instance.
  | the_thread | The thread of the node.
  [in,out] | The | node to update the priority of.

## ◆ _Scheduler_priority_affinity_SMP_Withdraw_node()

void _Scheduler_priority_affinity_SMP_Withdraw_node | ( | const Scheduler_Control * | scheduler,
|  | Thread_Control * | the_thread,
|  | Scheduler_Node * | node,
|  | Thread_Scheduler_state | next_state
| ) |  |

Withdraws node.

Parameters

  scheduler | The scheduler instance to withdraw the node.
  the_thread | The thread using the node.
  node | The scheduler node to withdraw.
  next_state | The next thread scheduler state in the case the node is scheduled.