diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-02-02 16:24:05 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-02-03 10:17:38 +0100 |
commit | ca1e546e7772838b20d0792155e2c71514d6b5d3 (patch) | |
tree | a5af2d74d6fcefa8d36f0fa32debd886e63cca4b /cpukit/score/include/rtems/score/schedulersmpimpl.h | |
parent | sparc: Fix volatile clobber (diff) | |
download | rtems-ca1e546e7772838b20d0792155e2c71514d6b5d3.tar.bz2 |
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.
Diffstat (limited to 'cpukit/score/include/rtems/score/schedulersmpimpl.h')
-rw-r--r-- | cpukit/score/include/rtems/score/schedulersmpimpl.h | 18 |
1 files changed, 10 insertions, 8 deletions
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( |