RTEMS: EDF Priority SMP Scheduler

| RTEMS 5.4-rc2

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

EDF Priority SMP Scheduler. More...

## Files
file | scheduleredfsmp.h
| EDF SMP Scheduler API.
file | scheduleredfsmp.c
| EDF SMP Scheduler Implementation.

## Data Structures
struct | Scheduler_EDF_SMP_Node
struct | Scheduler_EDF_SMP_Ready_queue
struct | Scheduler_EDF_SMP_Context

## Macros
#define | SCHEDULER_EDF_SMP_ENTRY_POINTS

## Functions
void | _Scheduler_EDF_SMP_Initialize (const Scheduler_Control *scheduler)
| Initializes the context of the scheduler control.
void | _Scheduler_EDF_SMP_Node_initialize (const Scheduler_Control *scheduler, Scheduler_Node *node, Thread_Control *the_thread, Priority_Control priority)
| Initializes the node with the given priority.
void | _Scheduler_EDF_SMP_Block (const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node)
| Blocks the thread.
void | _Scheduler_EDF_SMP_Unblock (const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node)
| Unblocks the thread.
void | _Scheduler_EDF_SMP_Update_priority (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
| Updates the priority of the node.
bool | _Scheduler_EDF_SMP_Ask_for_help (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
| Asks for help operation.
void | _Scheduler_EDF_SMP_Reconsider_help_request (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
| Reconsiders help operation.
void | _Scheduler_EDF_SMP_Withdraw_node (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node, Thread_Scheduler_state next_state)
| Withdraws node operation.
void | _Scheduler_EDF_SMP_Pin (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node, struct Per_CPU_Control *cpu)
| Pin thread operation.
void | _Scheduler_EDF_SMP_Unpin (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node, struct Per_CPU_Control *cpu)
| Unpin thread operation.
void | _Scheduler_EDF_SMP_Add_processor (const Scheduler_Control *scheduler, Thread_Control *idle)
| Adds processor.
Thread_Control * | _Scheduler_EDF_SMP_Remove_processor (const Scheduler_Control *scheduler, struct Per_CPU_Control *cpu)
| Removes an idle thread from the given cpu.
void | _Scheduler_EDF_SMP_Yield (const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node)
| Performs the yield of a thread.
void | _Scheduler_EDF_SMP_Start_idle (const Scheduler_Control *scheduler, Thread_Control *idle, struct Per_CPU_Control *cpu)
| Starts an idle thread.
bool | _Scheduler_EDF_SMP_Set_affinity (const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node, const Processor_mask *affinity)
| Checks if the processor set of the scheduler is the subset of the affinity set.

## Detailed Description

EDF Priority SMP Scheduler.

## Macro Definition Documentation

## ◆ SCHEDULER_EDF_SMP_ENTRY_POINTS

#define SCHEDULER_EDF_SMP_ENTRY_POINTS

Value:
{ \
_Scheduler_EDF_SMP_Initialize, \
_Scheduler_default_Schedule, \
_Scheduler_EDF_SMP_Yield, \
_Scheduler_EDF_SMP_Block, \
_Scheduler_EDF_SMP_Unblock, \
_Scheduler_EDF_SMP_Update_priority, \
_Scheduler_EDF_Map_priority, \
_Scheduler_EDF_Unmap_priority, \
_Scheduler_EDF_SMP_Ask_for_help, \
_Scheduler_EDF_SMP_Reconsider_help_request, \
_Scheduler_EDF_SMP_Withdraw_node, \
_Scheduler_EDF_SMP_Pin, \
_Scheduler_EDF_SMP_Unpin, \
_Scheduler_EDF_SMP_Add_processor, \
_Scheduler_EDF_SMP_Remove_processor, \
_Scheduler_EDF_SMP_Node_initialize, \
_Scheduler_default_Node_destroy, \
_Scheduler_EDF_Release_job, \
_Scheduler_EDF_Cancel_job, \
_Scheduler_default_Tick, \
_Scheduler_EDF_SMP_Start_idle, \
_Scheduler_EDF_SMP_Set_affinity \
}
_Scheduler_EDF_Cancel_job
void _Scheduler_EDF_Cancel_job(const Scheduler_Control *scheduler, Thread_Control *the_thread, Priority_Node *priority_node, Thread_queue_Context *queue_context)
Cancels a job and removes the thread from the queue context.
Definition: scheduleredfreleasejob.c:77
_Scheduler_EDF_Release_job
void _Scheduler_EDF_Release_job(const Scheduler_Control *scheduler, Thread_Control *the_thread, Priority_Node *priority_node, uint64_t deadline, Thread_queue_Context *queue_context)
Releases a EDF job.
Definition: scheduleredfreleasejob.c:40
_Scheduler_EDF_Map_priority
Priority_Control _Scheduler_EDF_Map_priority(const Scheduler_Control *scheduler, Priority_Control priority)
Gets the mapped priority map of the priority control.
Definition: scheduleredfreleasejob.c:24
_Scheduler_EDF_Unmap_priority
Priority_Control _Scheduler_EDF_Unmap_priority(const Scheduler_Control *scheduler, Priority_Control priority)
Gets the unmapped priority map of the priority control.
Definition: scheduleredfreleasejob.c:32
_Scheduler_EDF_SMP_Yield
void _Scheduler_EDF_SMP_Yield(const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node)
Performs the yield of a thread.
Definition: scheduleredfsmp.c:625
_Scheduler_EDF_SMP_Set_affinity
bool _Scheduler_EDF_SMP_Set_affinity(const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node, const Processor_mask *affinity)
Checks if the processor set of the scheduler is the subset of the affinity set.
Definition: scheduleredfsmp.c:719
_Scheduler_EDF_SMP_Start_idle
void _Scheduler_EDF_SMP_Start_idle(const Scheduler_Control *scheduler, Thread_Control *idle, struct Per_CPU_Control *cpu)
Starts an idle thread.
Definition: scheduleredfsmp.c:657
_Scheduler_EDF_SMP_Node_initialize
void _Scheduler_EDF_SMP_Node_initialize(const Scheduler_Control *scheduler, Scheduler_Node *node, Thread_Control *the_thread, Priority_Control priority)
Initializes the node with the given priority.
Definition: scheduleredfsmp.c:71
_Scheduler_EDF_SMP_Update_priority
void _Scheduler_EDF_SMP_Update_priority(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Updates the priority of the node.
Definition: scheduleredfsmp.c:512
_Scheduler_EDF_SMP_Unpin
void _Scheduler_EDF_SMP_Unpin(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node, struct Per_CPU_Control *cpu)
Unpin thread operation.
Definition: scheduleredfsmp.c:698
_Scheduler_EDF_SMP_Unblock
void _Scheduler_EDF_SMP_Unblock(const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node)
Unblocks the thread.
Definition: scheduleredfsmp.c:476
_Scheduler_EDF_SMP_Initialize
void _Scheduler_EDF_SMP_Initialize(const Scheduler_Control *scheduler)
Initializes the context of the scheduler control.
Definition: scheduleredfsmp.c:61
_Scheduler_EDF_SMP_Block
void _Scheduler_EDF_SMP_Block(const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node)
Blocks the thread.
Definition: scheduleredfsmp.c:417
_Scheduler_EDF_SMP_Remove_processor
Thread_Control * _Scheduler_EDF_SMP_Remove_processor(const Scheduler_Control *scheduler, struct Per_CPU_Control *cpu)
Removes an idle thread from the given cpu.
Definition: scheduleredfsmp.c:610
_Scheduler_EDF_SMP_Pin
void _Scheduler_EDF_SMP_Pin(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node, struct Per_CPU_Control *cpu)
Pin thread operation.
Definition: scheduleredfsmp.c:675
_Scheduler_EDF_SMP_Ask_for_help
bool _Scheduler_EDF_SMP_Ask_for_help(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Asks for help operation.
Definition: scheduleredfsmp.c:532
_Scheduler_EDF_SMP_Reconsider_help_request
void _Scheduler_EDF_SMP_Reconsider_help_request(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Reconsiders help operation.
Definition: scheduleredfsmp.c:543
_Scheduler_EDF_SMP_Add_processor
void _Scheduler_EDF_SMP_Add_processor(const Scheduler_Control *scheduler, Thread_Control *idle)
Adds processor.
Definition: scheduleredfsmp.c:594
_Scheduler_EDF_SMP_Withdraw_node
void _Scheduler_EDF_SMP_Withdraw_node(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node, Thread_Scheduler_state next_state)
Withdraws node operation.
Definition: scheduleredfsmp.c:559
_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_Node_destroy
void _Scheduler_default_Node_destroy(const Scheduler_Control *scheduler, Scheduler_Node *node)
Does nothing.
Definition: schedulerdefaultnodedestroy.c:24
_Scheduler_default_Schedule
void _Scheduler_default_Schedule(const Scheduler_Control *scheduler, Thread_Control *the_thread)
Does nothing.
Definition: schedulerdefaultschedule.c:15

## Function Documentation

## ◆ _Scheduler_EDF_SMP_Add_processor()

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

Adds processor.

Parameters

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

## ◆ _Scheduler_EDF_SMP_Ask_for_help()

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

Asks for help operation.

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_EDF_SMP_Block()

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

Blocks the thread.

Parameters

  | scheduler | The scheduler instance.
  [in,out] | the_thread | The thread to block.
  [in,out] | node | The thread's scheduler node.

## ◆ _Scheduler_EDF_SMP_Initialize()

void _Scheduler_EDF_SMP_Initialize | ( | const Scheduler_Control * | scheduler | ) |

Initializes the context of the scheduler control.

Parameters

  scheduler | The scheduler control.

## ◆ _Scheduler_EDF_SMP_Node_initialize()

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

Initializes the node with the given priority.

Parameters

  | scheduler | The scheduler instance.
  [out] | node | The node to initialize.
  | the_thread | The thread of the scheduler node.
  | priority | The priority for the initialization.

## ◆ _Scheduler_EDF_SMP_Pin()

void _Scheduler_EDF_SMP_Pin | ( | const Scheduler_Control * | scheduler,
|  | Thread_Control * | the_thread,
|  | Scheduler_Node * | node,
|  | struct Per_CPU_Control * | cpu
| ) |  |

Pin thread operation.

Parameters

  scheduler | The scheduler instance of the specified processor.
  the_thread | The thread to pin.
  node | The scheduler node of the thread.
  cpu | The processor to pin the thread.

## ◆ _Scheduler_EDF_SMP_Reconsider_help_request()

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

Reconsiders help operation.

Parameters

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

## ◆ _Scheduler_EDF_SMP_Remove_processor()

Thread_Control * _Scheduler_EDF_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_EDF_SMP_Set_affinity()

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

Checks if the processor set of the scheduler is the subset of the affinity set.

Default implementation of the set affinity scheduler operation.

Parameters

  scheduler | This parameter is unused.
  thread | This parameter is unused.
  node | This parameter is unused.
  affinity | The new processor affinity set for the thread.

Return values

  true | The processor set of the scheduler is a subset of the affinity set.
  false | The processor set of the scheduler is not a subset of the affinity set.

## ◆ _Scheduler_EDF_SMP_Start_idle()

void _Scheduler_EDF_SMP_Start_idle | ( | const Scheduler_Control * | scheduler,
|  | Thread_Control * | idle,
|  | struct Per_CPU_Control * | cpu
| ) |  |

Starts an idle thread.

Parameters

  | scheduler | The scheduler instance.
  [in,out] | the_thread | An idle thread.
  | cpu | The cpu for the operation.

## ◆ _Scheduler_EDF_SMP_Unblock()

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

Unblocks the thread.

Parameters

  | scheduler | The scheduler instance.
  [in,out] | the_thread | The thread to unblock.
  [in,out] | node | The thread's scheduler node.

## ◆ _Scheduler_EDF_SMP_Unpin()

void _Scheduler_EDF_SMP_Unpin | ( | const Scheduler_Control * | scheduler,
|  | Thread_Control * | the_thread,
|  | Scheduler_Node * | node,
|  | struct Per_CPU_Control * | cpu
| ) |  |

Unpin thread operation.

Parameters

  scheduler | The scheduler instance of the specified processor.
  the_thread | The thread to unpin.
  node | The scheduler node of the thread.
  cpu | The processor to unpin the thread.

## ◆ _Scheduler_EDF_SMP_Update_priority()

void _Scheduler_EDF_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 for the operation.
  node | The thread's scheduler node.

## ◆ _Scheduler_EDF_SMP_Withdraw_node()

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

Withdraws node operation.

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 case the node is scheduled.

## ◆ _Scheduler_EDF_SMP_Yield()

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

Performs the yield of a thread.

Parameters

  | scheduler | The scheduler instance.
  [in,out] | the_thread | The thread that performed the yield operation.
  | node | The scheduler node of the_thread.