summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score/schedulerimpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-10-15 11:21:31 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-11-23 11:00:28 +0100
commit3d6ebde1acab61e7c8fce1a1ed51517f7c2bf7c6 (patch)
tree53af30eda5f2f52317549afb9492b5a9f4cb7720 /cpukit/include/rtems/score/schedulerimpl.h
parentscore: Add SMP scheduler idle exchange callback (diff)
downloadrtems-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 'cpukit/include/rtems/score/schedulerimpl.h')
-rw-r--r--cpukit/include/rtems/score/schedulerimpl.h59
1 files changed, 0 insertions, 59 deletions
diff --git a/cpukit/include/rtems/score/schedulerimpl.h b/cpukit/include/rtems/score/schedulerimpl.h
index 7319cc4e4c..eb279876c7 100644
--- a/cpukit/include/rtems/score/schedulerimpl.h
+++ b/cpukit/include/rtems/score/schedulerimpl.h
@@ -405,65 +405,6 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Update_priority( Thread_Control *the_thread
#endif
}
-#if defined(RTEMS_SMP)
-/**
- * @brief Changes the sticky level of the home scheduler node and propagates a
- * priority change of a thread to the scheduler.
- *
- * @param the_thread The thread changing its priority or sticky level.
- *
- * @see _Scheduler_Update_priority().
- */
-RTEMS_INLINE_ROUTINE void _Scheduler_Priority_and_sticky_update(
- Thread_Control *the_thread,
- int sticky_level_change
-)
-{
- Chain_Node *node;
- const Chain_Node *tail;
- Scheduler_Node *scheduler_node;
- const Scheduler_Control *scheduler;
- ISR_lock_Context lock_context;
-
- _Thread_Scheduler_process_requests( the_thread );
-
- node = _Chain_First( &the_thread->Scheduler.Scheduler_nodes );
- scheduler_node = SCHEDULER_NODE_OF_THREAD_SCHEDULER_NODE( node );
- scheduler = _Scheduler_Node_get_scheduler( scheduler_node );
-
- _Scheduler_Acquire_critical( scheduler, &lock_context );
-
- scheduler_node->sticky_level += sticky_level_change;
- _Assert( scheduler_node->sticky_level >= 0 );
-
- ( *scheduler->Operations.update_priority )(
- scheduler,
- the_thread,
- scheduler_node
- );
-
- _Scheduler_Release_critical( scheduler, &lock_context );
-
- tail = _Chain_Immutable_tail( &the_thread->Scheduler.Scheduler_nodes );
- node = _Chain_Next( node );
-
- while ( node != tail ) {
- scheduler_node = SCHEDULER_NODE_OF_THREAD_SCHEDULER_NODE( node );
- scheduler = _Scheduler_Node_get_scheduler( scheduler_node );
-
- _Scheduler_Acquire_critical( scheduler, &lock_context );
- ( *scheduler->Operations.update_priority )(
- scheduler,
- the_thread,
- scheduler_node
- );
- _Scheduler_Release_critical( scheduler, &lock_context );
-
- node = _Chain_Next( node );
- }
-}
-#endif
-
/**
* @brief Maps a thread priority from the user domain to the scheduler domain.
*