diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-10-15 11:21:31 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-11-23 11:00:28 +0100 |
commit | 3d6ebde1acab61e7c8fce1a1ed51517f7c2bf7c6 (patch) | |
tree | 53af30eda5f2f52317549afb9492b5a9f4cb7720 /cpukit/score/src/schedulerstrongapa.c | |
parent | score: Add SMP scheduler idle exchange callback (diff) | |
download | rtems-3d6ebde1acab61e7c8fce1a1ed51517f7c2bf7c6.tar.bz2 |
score: Add SMP scheduler make/clean sticky
This patch fixes the following broken behaviour:
While a thread is scheduled on a helping scheduler, while it does not
own a MrsP semaphore, if it obtains a MrsP semaphore, then no
scheduler node using an idle thread and the ceiling priority of the
semaphore is unblocked for the home scheduler.
This could lead to priority inversion issues and is not in line
with the MrsP protocol.
Introduce two new scheduler operations which are only enabled if
RTEMS_SMP is defined. The operations are used to make the scheduler
node of the home scheduler sticky and to clean the sticky property.
This helps to keep the sticky handing out of the frequently used
priority update operation.
Close #4532.
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/src/schedulerstrongapa.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/cpukit/score/src/schedulerstrongapa.c b/cpukit/score/src/schedulerstrongapa.c index afd9fcc709..6c7ab942fa 100644 --- a/cpukit/score/src/schedulerstrongapa.c +++ b/cpukit/score/src/schedulerstrongapa.c @@ -31,7 +31,9 @@ * _Scheduler_strong_APA_Set_affinity(), * _Scheduler_strong_APA_Set_scheduled(), _Scheduler_strong_APA_Start_idle(), * _Scheduler_strong_APA_Unblock(), _Scheduler_strong_APA_Update_priority(), - * _Scheduler_strong_APA_Withdraw_node(), and _Scheduler_strong_APA_Yield(). + * _Scheduler_strong_APA_Withdraw_node(), + * _Scheduler_strong_APA_Make_sticky(), _Scheduler_strong_APA_Clean_sticky(), + * and _Scheduler_strong_APA_Yield(). */ /* @@ -935,6 +937,39 @@ void _Scheduler_strong_APA_Withdraw_node( ); } +void _Scheduler_strong_APA_Make_sticky( + const Scheduler_Control *scheduler, + Thread_Control *the_thread, + Scheduler_Node *node +) +{ + _Scheduler_SMP_Make_sticky( + scheduler, + the_thread, + node, + _Scheduler_strong_APA_Do_update, + _Scheduler_strong_APA_Enqueue + ); +} + +void _Scheduler_strong_APA_Clean_sticky( + const Scheduler_Control *scheduler, + Thread_Control *the_thread, + Scheduler_Node *node +) +{ + _Scheduler_SMP_Clean_sticky( + scheduler, + the_thread, + node, + _Scheduler_SMP_Extract_from_scheduled, + _Scheduler_strong_APA_Extract_from_ready, + _Scheduler_strong_APA_Get_highest_ready, + _Scheduler_strong_APA_Move_from_ready_to_scheduled, + _Scheduler_strong_APA_Allocate_processor + ); +} + static inline void _Scheduler_strong_APA_Register_idle( Scheduler_Context *context, Scheduler_Node *idle_base, |