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/src/schedulercbsunblock.c | 3 +-- cpukit/score/src/scheduleredfunblock.c | 4 +--- cpukit/score/src/scheduleredfyield.c | 4 +--- cpukit/score/src/schedulerpriorityaffinitysmp.c | 7 ++----- cpukit/score/src/schedulerprioritysmp.c | 8 ++++---- cpukit/score/src/schedulerpriorityunblock.c | 4 +--- cpukit/score/src/schedulerpriorityyield.c | 4 +--- cpukit/score/src/schedulersimplesmp.c | 8 ++++---- cpukit/score/src/schedulersimpleunblock.c | 4 +--- cpukit/score/src/schedulersimpleyield.c | 4 +--- cpukit/score/src/schedulerstrongapa.c | 8 ++++---- 11 files changed, 21 insertions(+), 37 deletions(-) (limited to 'cpukit/score/src') diff --git a/cpukit/score/src/schedulercbsunblock.c b/cpukit/score/src/schedulercbsunblock.c index be9696eed8..403435eeb1 100644 --- a/cpukit/score/src/schedulercbsunblock.c +++ b/cpukit/score/src/schedulercbsunblock.c @@ -25,7 +25,7 @@ #include #include -Scheduler_Void_or_bool _Scheduler_CBS_Unblock( +void _Scheduler_CBS_Unblock( const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node @@ -68,5 +68,4 @@ Scheduler_Void_or_bool _Scheduler_CBS_Unblock( } _Scheduler_EDF_Unblock( scheduler, the_thread, &the_node->Base.Base ); - SCHEDULER_RETURN_VOID_OR_BOOL; } diff --git a/cpukit/score/src/scheduleredfunblock.c b/cpukit/score/src/scheduleredfunblock.c index 45653396af..29355d04fa 100644 --- a/cpukit/score/src/scheduleredfunblock.c +++ b/cpukit/score/src/scheduleredfunblock.c @@ -22,7 +22,7 @@ #include #include -Scheduler_Void_or_bool _Scheduler_EDF_Unblock( +void _Scheduler_EDF_Unblock( const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node @@ -59,6 +59,4 @@ Scheduler_Void_or_bool _Scheduler_EDF_Unblock( priority == ( SCHEDULER_EDF_PRIO_MSB | PRIORITY_PSEUDO_ISR ) ); } - - SCHEDULER_RETURN_VOID_OR_BOOL; } diff --git a/cpukit/score/src/scheduleredfyield.c b/cpukit/score/src/scheduleredfyield.c index dfcb4d3569..4adb4f5121 100644 --- a/cpukit/score/src/scheduleredfyield.c +++ b/cpukit/score/src/scheduleredfyield.c @@ -21,7 +21,7 @@ #include -Scheduler_Void_or_bool _Scheduler_EDF_Yield( +void _Scheduler_EDF_Yield( const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node @@ -36,6 +36,4 @@ Scheduler_Void_or_bool _Scheduler_EDF_Yield( _Scheduler_EDF_Extract( context, the_node ); _Scheduler_EDF_Enqueue( context, the_node, the_node->priority ); _Scheduler_EDF_Schedule_body( scheduler, the_thread, true ); - - SCHEDULER_RETURN_VOID_OR_BOOL; } diff --git a/cpukit/score/src/schedulerpriorityaffinitysmp.c b/cpukit/score/src/schedulerpriorityaffinitysmp.c index 7689469c54..8b54295122 100644 --- a/cpukit/score/src/schedulerpriorityaffinitysmp.c +++ b/cpukit/score/src/schedulerpriorityaffinitysmp.c @@ -352,16 +352,15 @@ static void _Scheduler_priority_affinity_SMP_Check_for_migrations( /* * This is the public scheduler specific Unblock operation. */ -bool _Scheduler_priority_affinity_SMP_Unblock( +void _Scheduler_priority_affinity_SMP_Unblock( const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node ) { Scheduler_Context *context = _Scheduler_Get_context( scheduler ); - bool needs_help; - needs_help = _Scheduler_SMP_Unblock( + _Scheduler_SMP_Unblock( context, thread, node, @@ -373,8 +372,6 @@ bool _Scheduler_priority_affinity_SMP_Unblock( * Perform any thread migrations that are needed due to these changes. */ _Scheduler_priority_affinity_SMP_Check_for_migrations( context ); - - return needs_help; } /* diff --git a/cpukit/score/src/schedulerprioritysmp.c b/cpukit/score/src/schedulerprioritysmp.c index b4786ea872..5548ebf8e8 100644 --- a/cpukit/score/src/schedulerprioritysmp.c +++ b/cpukit/score/src/schedulerprioritysmp.c @@ -206,7 +206,7 @@ static bool _Scheduler_priority_SMP_Enqueue_scheduled_fifo( ); } -bool _Scheduler_priority_SMP_Unblock( +void _Scheduler_priority_SMP_Unblock( const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node @@ -214,7 +214,7 @@ bool _Scheduler_priority_SMP_Unblock( { Scheduler_Context *context = _Scheduler_Get_context( scheduler ); - return _Scheduler_SMP_Unblock( + _Scheduler_SMP_Unblock( context, thread, node, @@ -342,7 +342,7 @@ Thread_Control *_Scheduler_priority_SMP_Remove_processor( ); } -bool _Scheduler_priority_SMP_Yield( +void _Scheduler_priority_SMP_Yield( const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node @@ -350,7 +350,7 @@ bool _Scheduler_priority_SMP_Yield( { Scheduler_Context *context = _Scheduler_Get_context( scheduler ); - return _Scheduler_SMP_Yield( + _Scheduler_SMP_Yield( context, thread, node, diff --git a/cpukit/score/src/schedulerpriorityunblock.c b/cpukit/score/src/schedulerpriorityunblock.c index 405b83f350..42ba4de98f 100644 --- a/cpukit/score/src/schedulerpriorityunblock.c +++ b/cpukit/score/src/schedulerpriorityunblock.c @@ -22,7 +22,7 @@ #include -Scheduler_Void_or_bool _Scheduler_priority_Unblock ( +void _Scheduler_priority_Unblock ( const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node @@ -71,6 +71,4 @@ Scheduler_Void_or_bool _Scheduler_priority_Unblock ( if ( priority < _Thread_Get_priority( _Thread_Heir ) ) { _Scheduler_Update_heir( the_thread, priority == PRIORITY_PSEUDO_ISR ); } - - SCHEDULER_RETURN_VOID_OR_BOOL; } diff --git a/cpukit/score/src/schedulerpriorityyield.c b/cpukit/score/src/schedulerpriorityyield.c index 439877d0ce..c12b759f83 100644 --- a/cpukit/score/src/schedulerpriorityyield.c +++ b/cpukit/score/src/schedulerpriorityyield.c @@ -21,7 +21,7 @@ #include #include -Scheduler_Void_or_bool _Scheduler_priority_Yield( +void _Scheduler_priority_Yield( const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node @@ -39,6 +39,4 @@ Scheduler_Void_or_bool _Scheduler_priority_Yield( } _Scheduler_priority_Schedule_body( scheduler, the_thread, true ); - - SCHEDULER_RETURN_VOID_OR_BOOL; } diff --git a/cpukit/score/src/schedulersimplesmp.c b/cpukit/score/src/schedulersimplesmp.c index 221fcc3df5..41eb491019 100644 --- a/cpukit/score/src/schedulersimplesmp.c +++ b/cpukit/score/src/schedulersimplesmp.c @@ -281,7 +281,7 @@ static bool _Scheduler_simple_SMP_Enqueue_scheduled_fifo( ); } -bool _Scheduler_simple_SMP_Unblock( +void _Scheduler_simple_SMP_Unblock( const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node @@ -289,7 +289,7 @@ bool _Scheduler_simple_SMP_Unblock( { Scheduler_Context *context = _Scheduler_Get_context( scheduler ); - return _Scheduler_SMP_Unblock( + _Scheduler_SMP_Unblock( context, thread, node, @@ -417,7 +417,7 @@ Thread_Control *_Scheduler_simple_SMP_Remove_processor( ); } -bool _Scheduler_simple_SMP_Yield( +void _Scheduler_simple_SMP_Yield( const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node @@ -425,7 +425,7 @@ bool _Scheduler_simple_SMP_Yield( { Scheduler_Context *context = _Scheduler_Get_context( scheduler ); - return _Scheduler_SMP_Yield( + _Scheduler_SMP_Yield( context, thread, node, diff --git a/cpukit/score/src/schedulersimpleunblock.c b/cpukit/score/src/schedulersimpleunblock.c index fe02ece5b2..5540e20e87 100644 --- a/cpukit/score/src/schedulersimpleunblock.c +++ b/cpukit/score/src/schedulersimpleunblock.c @@ -21,7 +21,7 @@ #include #include -Scheduler_Void_or_bool _Scheduler_simple_Unblock( +void _Scheduler_simple_Unblock( const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node @@ -54,6 +54,4 @@ Scheduler_Void_or_bool _Scheduler_simple_Unblock( priority == PRIORITY_PSEUDO_ISR ); } - - SCHEDULER_RETURN_VOID_OR_BOOL; } diff --git a/cpukit/score/src/schedulersimpleyield.c b/cpukit/score/src/schedulersimpleyield.c index c84f571933..0c150d8b1f 100644 --- a/cpukit/score/src/schedulersimpleyield.c +++ b/cpukit/score/src/schedulersimpleyield.c @@ -20,7 +20,7 @@ #include -Scheduler_Void_or_bool _Scheduler_simple_Yield( +void _Scheduler_simple_Yield( const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node @@ -34,6 +34,4 @@ Scheduler_Void_or_bool _Scheduler_simple_Yield( _Chain_Extract_unprotected( &the_thread->Object.Node ); _Scheduler_simple_Insert_priority_fifo( &context->Ready, the_thread ); _Scheduler_simple_Schedule_body( scheduler, the_thread, false ); - - SCHEDULER_RETURN_VOID_OR_BOOL; } diff --git a/cpukit/score/src/schedulerstrongapa.c b/cpukit/score/src/schedulerstrongapa.c index 07d27e97b2..d8d3280ed9 100644 --- a/cpukit/score/src/schedulerstrongapa.c +++ b/cpukit/score/src/schedulerstrongapa.c @@ -340,7 +340,7 @@ static bool _Scheduler_strong_APA_Enqueue_scheduled_fifo( ); } -bool _Scheduler_strong_APA_Unblock( +void _Scheduler_strong_APA_Unblock( const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node @@ -348,7 +348,7 @@ bool _Scheduler_strong_APA_Unblock( { Scheduler_Context *context = _Scheduler_Get_context( scheduler ); - return _Scheduler_SMP_Unblock( + _Scheduler_SMP_Unblock( context, the_thread, node, @@ -476,7 +476,7 @@ Thread_Control *_Scheduler_strong_APA_Remove_processor( ); } -bool _Scheduler_strong_APA_Yield( +void _Scheduler_strong_APA_Yield( const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node @@ -484,7 +484,7 @@ bool _Scheduler_strong_APA_Yield( { Scheduler_Context *context = _Scheduler_Get_context( scheduler ); - return _Scheduler_SMP_Yield( + _Scheduler_SMP_Yield( context, the_thread, node, -- cgit v1.2.3