From ca1e546e7772838b20d0792155e2c71514d6b5d3 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 2 Feb 2017 16:24:05 +0100 Subject: score: Improve scheduler helping protocol Only register ask for help requests in the scheduler unblock and yield operations. The actual ask for help operation is carried out during _Thread_Do_dispatch() on a processor related to the thread. This yields a better separation of scheduler instances. A thread of one scheduler instance should not be forced to carry out too much work for threads on other scheduler instances. Update #2556. --- cpukit/score/include/rtems/score/schedulersmpimpl.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'cpukit/score/include/rtems/score/schedulersmpimpl.h') diff --git a/cpukit/score/include/rtems/score/schedulersmpimpl.h b/cpukit/score/include/rtems/score/schedulersmpimpl.h index 92a22d2ff8..7a281277fa 100644 --- a/cpukit/score/include/rtems/score/schedulersmpimpl.h +++ b/cpukit/score/include/rtems/score/schedulersmpimpl.h @@ -962,7 +962,7 @@ static inline void _Scheduler_SMP_Block( } } -static inline bool _Scheduler_SMP_Unblock( +static inline void _Scheduler_SMP_Unblock( Scheduler_Context *context, Thread_Control *thread, Scheduler_Node *node, @@ -972,7 +972,6 @@ static inline bool _Scheduler_SMP_Unblock( { Scheduler_SMP_Node_state node_state; bool unblock; - bool needs_help; node_state = _Scheduler_SMP_Node_state( node ); unblock = _Scheduler_Unblock_node( @@ -986,6 +985,7 @@ static inline bool _Scheduler_SMP_Unblock( if ( unblock ) { Priority_Control new_priority; bool prepend_it; + bool needs_help; new_priority = _Scheduler_Node_get_priority( node, &prepend_it ); (void) prepend_it; @@ -1004,11 +1004,11 @@ static inline bool _Scheduler_SMP_Unblock( _Assert( node->idle == NULL ); needs_help = true; } - } else { - needs_help = false; - } - return needs_help; + if ( needs_help ) { + _Scheduler_Ask_for_help( thread ); + } + } } static inline void _Scheduler_SMP_Update_priority( @@ -1069,7 +1069,7 @@ static inline void _Scheduler_SMP_Update_priority( } } -static inline bool _Scheduler_SMP_Yield( +static inline void _Scheduler_SMP_Yield( Scheduler_Context *context, Thread_Control *thread, Scheduler_Node *node, @@ -1095,7 +1095,9 @@ static inline bool _Scheduler_SMP_Yield( needs_help = true; } - return needs_help; + if ( needs_help ) { + _Scheduler_Ask_for_help( thread ); + } } static inline void _Scheduler_SMP_Insert_scheduled_lifo( -- cgit v1.2.3