[rtems commit] score: Improve scheduler helping protocol

Sebastian Huber sebh at rtems.org
Fri Feb 3 09:57:59 UTC 2017


Module:    rtems
Branch:    master
Commit:    ca1e546e7772838b20d0792155e2c71514d6b5d3
Changeset: http://git.rtems.org/rtems/commit/?id=ca1e546e7772838b20d0792155e2c71514d6b5d3

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Feb  2 16:24:05 2017 +0100

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/scheduler.h       |  14 +--
 cpukit/score/include/rtems/score/schedulercbs.h    |   2 +-
 cpukit/score/include/rtems/score/scheduleredf.h    |   4 +-
 cpukit/score/include/rtems/score/schedulerimpl.h   | 139 ++++++---------------
 .../score/include/rtems/score/schedulerpriority.h  |   4 +-
 .../rtems/score/schedulerpriorityaffinitysmp.h     |   2 +-
 .../include/rtems/score/schedulerprioritysmp.h     |   4 +-
 cpukit/score/include/rtems/score/schedulersimple.h |   4 +-
 .../score/include/rtems/score/schedulersimplesmp.h |   4 +-
 .../score/include/rtems/score/schedulersmpimpl.h   |  18 +--
 .../score/include/rtems/score/schedulerstrongapa.h |   4 +-
 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 +-
 testsuites/smptests/smpscheduler03/init.c          |  26 +---
 23 files changed, 94 insertions(+), 189 deletions(-)

diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h
index fd59f16..1b9509a 100644
--- a/cpukit/score/include/rtems/score/scheduler.h
+++ b/cpukit/score/include/rtems/score/scheduler.h
@@ -42,16 +42,6 @@ struct Per_CPU_Control;
 
 typedef struct Scheduler_Control Scheduler_Control;
 
-#if defined(RTEMS_SMP)
-  typedef bool Scheduler_Void_or_bool;
-
-  #define SCHEDULER_RETURN_VOID_OR_BOOL return false
-#else
-  typedef void Scheduler_Void_or_bool;
-
-  #define SCHEDULER_RETURN_VOID_OR_BOOL return
-#endif
-
 /**
  * @brief The scheduler operations.
  */
@@ -63,7 +53,7 @@ typedef struct {
   void ( *schedule )( const Scheduler_Control *, Thread_Control *);
 
   /** @see _Scheduler_Yield() */
-  Scheduler_Void_or_bool ( *yield )(
+  void ( *yield )(
     const Scheduler_Control *,
     Thread_Control *,
     Scheduler_Node *
@@ -77,7 +67,7 @@ typedef struct {
   );
 
   /** @see _Scheduler_Unblock() */
-  Scheduler_Void_or_bool ( *unblock )(
+  void ( *unblock )(
     const Scheduler_Control *,
     Thread_Control *,
     Scheduler_Node *
diff --git a/cpukit/score/include/rtems/score/schedulercbs.h b/cpukit/score/include/rtems/score/schedulercbs.h
index e56747b..635abce 100644
--- a/cpukit/score/include/rtems/score/schedulercbs.h
+++ b/cpukit/score/include/rtems/score/schedulercbs.h
@@ -146,7 +146,7 @@ typedef struct {
  */
 extern Scheduler_CBS_Server _Scheduler_CBS_Server_list[];
 
-Scheduler_Void_or_bool _Scheduler_CBS_Unblock(
+void _Scheduler_CBS_Unblock(
   const Scheduler_Control *scheduler,
   Thread_Control          *the_thread,
   Scheduler_Node          *node
diff --git a/cpukit/score/include/rtems/score/scheduleredf.h b/cpukit/score/include/rtems/score/scheduleredf.h
index 9fc2eb9..91c303c 100644
--- a/cpukit/score/include/rtems/score/scheduleredf.h
+++ b/cpukit/score/include/rtems/score/scheduleredf.h
@@ -144,7 +144,7 @@ void _Scheduler_EDF_Node_initialize(
   Priority_Control         priority
 );
 
-Scheduler_Void_or_bool _Scheduler_EDF_Unblock(
+void _Scheduler_EDF_Unblock(
   const Scheduler_Control *scheduler,
   Thread_Control          *the_thread,
   Scheduler_Node          *node
@@ -166,7 +166,7 @@ Priority_Control _Scheduler_EDF_Unmap_priority(
   Priority_Control         priority
 );
 
-Scheduler_Void_or_bool _Scheduler_EDF_Yield(
+void _Scheduler_EDF_Yield(
   const Scheduler_Control *scheduler,
   Thread_Control          *the_thread,
   Scheduler_Node          *node
diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h
index 90a9bcc..53631ab 100644
--- a/cpukit/score/include/rtems/score/schedulerimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerimpl.h
@@ -113,6 +113,43 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Release_critical(
 #endif
 }
 
+#if defined(RTEMS_SMP)
+/**
+ * @brief Registers an ask for help request.
+ *
+ * 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.
+ *
+ * @param[in] the_thread The thread in need for help.
+ */
+RTEMS_INLINE_ROUTINE void _Scheduler_Ask_for_help( Thread_Control *the_thread )
+{
+  _Assert( _Thread_State_is_owner( the_thread ) );
+
+  if ( the_thread->Scheduler.helping_nodes > 0 ) {
+    ISR_lock_Context  lock_context;
+    Per_CPU_Control  *cpu;
+
+    _Thread_Scheduler_acquire_critical( the_thread, &lock_context );
+    cpu = _Thread_Get_CPU( the_thread );
+    _Per_CPU_Acquire( cpu );
+
+    _Chain_Append_unprotected(
+      &cpu->Threads_in_need_for_help,
+      &the_thread->Scheduler.Help_node
+    );
+
+    _Per_CPU_Release( cpu );
+    _Thread_Scheduler_release_critical( the_thread, &lock_context );
+
+    _Thread_Dispatch_request( _Per_CPU_Get(), cpu );
+  }
+}
+#endif
+
 /**
  * The preferred method to add a new scheduler is to define the jump table
  * entries and add a case to the _Scheduler_Initialize routine.
@@ -159,64 +196,17 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( Thread_Control *the_thread )
  */
 RTEMS_INLINE_ROUTINE void _Scheduler_Yield( Thread_Control *the_thread )
 {
-#if defined(RTEMS_SMP)
-  Chain_Node              *node;
-  const Chain_Node        *tail;
-  Scheduler_Node          *scheduler_node;
   const Scheduler_Control *scheduler;
   ISR_lock_Context         lock_context;
-  bool                     needs_help;
-
-  node = _Chain_First( &the_thread->Scheduler.Scheduler_nodes );
-  tail = _Chain_Immutable_tail( &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 );
-  needs_help = ( *scheduler->Operations.yield )(
-    scheduler,
-    the_thread,
-    _Thread_Scheduler_get_home_node( the_thread )
-  );
-  _Scheduler_Release_critical( scheduler, &lock_context );
-
-  if ( !needs_help ) {
-    return;
-  }
-
-  node = _Chain_Next( node );
-
-  while ( node != tail ) {
-    bool success;
-
-    scheduler_node = SCHEDULER_NODE_OF_THREAD_SCHEDULER_NODE( node );
-    scheduler = _Scheduler_Node_get_scheduler( scheduler_node );
-
-    _Scheduler_Acquire_critical( scheduler, &lock_context );
-    success = ( *scheduler->Operations.ask_for_help )(
-      scheduler,
-      the_thread,
-      scheduler_node
-    );
-    _Scheduler_Release_critical( scheduler, &lock_context );
-
-    if ( success ) {
-      break;
-    }
-
-    node = _Chain_Next( node );
-  }
-#else
-  const Scheduler_Control *scheduler;
 
   scheduler = _Thread_Scheduler_get_home( the_thread );
+  _Scheduler_Acquire_critical( scheduler, &lock_context );
   ( *scheduler->Operations.yield )(
     scheduler,
     the_thread,
     _Thread_Scheduler_get_home_node( the_thread )
   );
-#endif
+  _Scheduler_Release_critical( scheduler, &lock_context );
 }
 
 /**
@@ -293,64 +283,17 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Block( Thread_Control *the_thread )
  */
 RTEMS_INLINE_ROUTINE void _Scheduler_Unblock( Thread_Control *the_thread )
 {
-#if defined(RTEMS_SMP)
-  Chain_Node              *node;
-  const Chain_Node        *tail;
-  Scheduler_Node          *scheduler_node;
   const Scheduler_Control *scheduler;
   ISR_lock_Context         lock_context;
-  bool                     needs_help;
-
-  node = _Chain_First( &the_thread->Scheduler.Scheduler_nodes );
-  tail = _Chain_Immutable_tail( &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 );
-  needs_help = ( *scheduler->Operations.unblock )(
-    scheduler,
-    the_thread,
-    scheduler_node
-  );
-  _Scheduler_Release_critical( scheduler, &lock_context );
-
-  if ( !needs_help ) {
-    return;
-  }
-
-  node = _Chain_Next( node );
-
-  while ( node != tail ) {
-    bool success;
-
-    scheduler_node = SCHEDULER_NODE_OF_THREAD_SCHEDULER_NODE( node );
-    scheduler = _Scheduler_Node_get_scheduler( scheduler_node );
-
-    _Scheduler_Acquire_critical( scheduler, &lock_context );
-    success = ( *scheduler->Operations.ask_for_help )(
-      scheduler,
-      the_thread,
-      scheduler_node
-    );
-    _Scheduler_Release_critical( scheduler, &lock_context );
-
-    if ( success ) {
-      break;
-    }
-
-    node = _Chain_Next( node );
-  }
-#else
-  const Scheduler_Control *scheduler;
 
   scheduler = _Thread_Scheduler_get_home( the_thread );
+  _Scheduler_Acquire_critical( scheduler, &lock_context );
   ( *scheduler->Operations.unblock )(
     scheduler,
     the_thread,
     _Thread_Scheduler_get_home_node( the_thread )
   );
-#endif
+  _Scheduler_Release_critical( scheduler, &lock_context );
 }
 
 /**
diff --git a/cpukit/score/include/rtems/score/schedulerpriority.h b/cpukit/score/include/rtems/score/schedulerpriority.h
index 91ebb38..f5ae661 100644
--- a/cpukit/score/include/rtems/score/schedulerpriority.h
+++ b/cpukit/score/include/rtems/score/schedulerpriority.h
@@ -128,7 +128,7 @@ void _Scheduler_priority_Schedule(
   Thread_Control          *the_thread
 );
 
-Scheduler_Void_or_bool _Scheduler_priority_Unblock(
+void _Scheduler_priority_Unblock(
   const Scheduler_Control *scheduler,
   Thread_Control          *the_thread,
   Scheduler_Node          *node
@@ -147,7 +147,7 @@ void _Scheduler_priority_Node_initialize(
   Priority_Control         priority
 );
 
-Scheduler_Void_or_bool _Scheduler_priority_Yield(
+void _Scheduler_priority_Yield(
   const Scheduler_Control *scheduler,
   Thread_Control          *the_thread,
   Scheduler_Node          *node
diff --git a/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h b/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h
index d1275bc..850c72b 100644
--- a/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h
+++ b/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h
@@ -96,7 +96,7 @@ void _Scheduler_priority_affinity_SMP_Block(
   Scheduler_Node          *node
 );
 
-bool _Scheduler_priority_affinity_SMP_Unblock(
+void _Scheduler_priority_affinity_SMP_Unblock(
   const Scheduler_Control *scheduler,
   Thread_Control          *thread,
   Scheduler_Node          *node
diff --git a/cpukit/score/include/rtems/score/schedulerprioritysmp.h b/cpukit/score/include/rtems/score/schedulerprioritysmp.h
index 75cc9b6..6671da5 100644
--- a/cpukit/score/include/rtems/score/schedulerprioritysmp.h
+++ b/cpukit/score/include/rtems/score/schedulerprioritysmp.h
@@ -115,7 +115,7 @@ void _Scheduler_priority_SMP_Block(
   Scheduler_Node          *node
 );
 
-bool _Scheduler_priority_SMP_Unblock(
+void _Scheduler_priority_SMP_Unblock(
   const Scheduler_Control *scheduler,
   Thread_Control          *thread,
   Scheduler_Node          *node
@@ -156,7 +156,7 @@ Thread_Control *_Scheduler_priority_SMP_Remove_processor(
   struct Per_CPU_Control  *cpu
 );
 
-bool _Scheduler_priority_SMP_Yield(
+void _Scheduler_priority_SMP_Yield(
   const Scheduler_Control *scheduler,
   Thread_Control          *thread,
   Scheduler_Node          *node
diff --git a/cpukit/score/include/rtems/score/schedulersimple.h b/cpukit/score/include/rtems/score/schedulersimple.h
index 1d97e1c..0d410d5 100644
--- a/cpukit/score/include/rtems/score/schedulersimple.h
+++ b/cpukit/score/include/rtems/score/schedulersimple.h
@@ -92,7 +92,7 @@ void _Scheduler_simple_Schedule(
   Thread_Control          *the_thread
 );
 
-Scheduler_Void_or_bool _Scheduler_simple_Yield(
+void _Scheduler_simple_Yield(
   const Scheduler_Control *scheduler,
   Thread_Control          *the_thread,
   Scheduler_Node          *node
@@ -104,7 +104,7 @@ void _Scheduler_simple_Block(
   Scheduler_Node          *node
 );
 
-Scheduler_Void_or_bool _Scheduler_simple_Unblock(
+void _Scheduler_simple_Unblock(
   const Scheduler_Control *scheduler,
   Thread_Control          *the_thread,
   Scheduler_Node          *node
diff --git a/cpukit/score/include/rtems/score/schedulersimplesmp.h b/cpukit/score/include/rtems/score/schedulersimplesmp.h
index 0cf3877..bc75b20 100644
--- a/cpukit/score/include/rtems/score/schedulersimplesmp.h
+++ b/cpukit/score/include/rtems/score/schedulersimplesmp.h
@@ -98,7 +98,7 @@ void _Scheduler_simple_SMP_Block(
   Scheduler_Node          *node
 );
 
-bool _Scheduler_simple_SMP_Unblock(
+void _Scheduler_simple_SMP_Unblock(
   const Scheduler_Control *scheduler,
   Thread_Control          *thread,
   Scheduler_Node          *node
@@ -139,7 +139,7 @@ Thread_Control *_Scheduler_simple_SMP_Remove_processor(
   struct Per_CPU_Control  *cpu
 );
 
-bool _Scheduler_simple_SMP_Yield(
+void _Scheduler_simple_SMP_Yield(
   const Scheduler_Control *scheduler,
   Thread_Control          *thread,
   Scheduler_Node          *node
diff --git a/cpukit/score/include/rtems/score/schedulersmpimpl.h b/cpukit/score/include/rtems/score/schedulersmpimpl.h
index 92a22d2..7a28127 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(
diff --git a/cpukit/score/include/rtems/score/schedulerstrongapa.h b/cpukit/score/include/rtems/score/schedulerstrongapa.h
index 29dee66..d961f20 100644
--- a/cpukit/score/include/rtems/score/schedulerstrongapa.h
+++ b/cpukit/score/include/rtems/score/schedulerstrongapa.h
@@ -115,7 +115,7 @@ void _Scheduler_strong_APA_Block(
   Scheduler_Node          *node
 );
 
-bool _Scheduler_strong_APA_Unblock(
+void _Scheduler_strong_APA_Unblock(
   const Scheduler_Control *scheduler,
   Thread_Control          *the_thread,
   Scheduler_Node          *node
@@ -156,7 +156,7 @@ Thread_Control *_Scheduler_strong_APA_Remove_processor(
   struct Per_CPU_Control  *cpu
 );
 
-bool _Scheduler_strong_APA_Yield(
+void _Scheduler_strong_APA_Yield(
   const Scheduler_Control *scheduler,
   Thread_Control          *the_thread,
   Scheduler_Node          *node
diff --git a/cpukit/score/src/schedulercbsunblock.c b/cpukit/score/src/schedulercbsunblock.c
index be9696e..403435e 100644
--- a/cpukit/score/src/schedulercbsunblock.c
+++ b/cpukit/score/src/schedulercbsunblock.c
@@ -25,7 +25,7 @@
 #include <rtems/score/threadimpl.h>
 #include <rtems/score/watchdogimpl.h>
 
-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 4565339..29355d0 100644
--- a/cpukit/score/src/scheduleredfunblock.c
+++ b/cpukit/score/src/scheduleredfunblock.c
@@ -22,7 +22,7 @@
 #include <rtems/score/schedulerimpl.h>
 #include <rtems/score/thread.h>
 
-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 dfcb4d3..4adb4f5 100644
--- a/cpukit/score/src/scheduleredfyield.c
+++ b/cpukit/score/src/scheduleredfyield.c
@@ -21,7 +21,7 @@
 
 #include <rtems/score/scheduleredfimpl.h>
 
-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 7689469..8b54295 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 b4786ea..5548ebf 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 405b83f..42ba4de 100644
--- a/cpukit/score/src/schedulerpriorityunblock.c
+++ b/cpukit/score/src/schedulerpriorityunblock.c
@@ -22,7 +22,7 @@
 
 #include <rtems/score/schedulerpriorityimpl.h>
 
-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 439877d..c12b759 100644
--- a/cpukit/score/src/schedulerpriorityyield.c
+++ b/cpukit/score/src/schedulerpriorityyield.c
@@ -21,7 +21,7 @@
 #include <rtems/score/schedulerpriorityimpl.h>
 #include <rtems/score/threadimpl.h>
 
-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 221fcc3..41eb491 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 fe02ece..5540e20 100644
--- a/cpukit/score/src/schedulersimpleunblock.c
+++ b/cpukit/score/src/schedulersimpleunblock.c
@@ -21,7 +21,7 @@
 #include <rtems/score/schedulersimpleimpl.h>
 #include <rtems/score/thread.h>
 
-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 c84f571..0c150d8 100644
--- a/cpukit/score/src/schedulersimpleyield.c
+++ b/cpukit/score/src/schedulersimpleyield.c
@@ -20,7 +20,7 @@
 
 #include <rtems/score/schedulersimpleimpl.h>
 
-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 07d27e9..d8d3280 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,
diff --git a/testsuites/smptests/smpscheduler03/init.c b/testsuites/smptests/smpscheduler03/init.c
index 51098b6..e4aa985 100644
--- a/testsuites/smptests/smpscheduler03/init.c
+++ b/testsuites/smptests/smpscheduler03/init.c
@@ -315,7 +315,7 @@ static void test_update_priority_op(void)
   rtems_test_assert(sc == RTEMS_SUCCESSFUL);
 }
 
-static bool yield_op(
+static void yield_op(
   Thread_Control *thread,
   Scheduler_SMP_Node *scheduler_node
 )
@@ -323,13 +323,12 @@ static bool yield_op(
   const Scheduler_Control *scheduler;
   ISR_lock_Context state_lock_context;
   ISR_lock_Context scheduler_lock_context;
-  bool needs_help;
 
   _Thread_State_acquire( thread, &state_lock_context );
   scheduler = _Thread_Scheduler_get_home( thread );
   _Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
 
-  needs_help = (*scheduler->Operations.yield)(
+  (*scheduler->Operations.yield)(
     scheduler,
     thread,
     &scheduler_node->Base
@@ -337,8 +336,6 @@ static bool yield_op(
 
   _Scheduler_Release_critical( scheduler, &scheduler_lock_context );
   _Thread_State_release( thread, &state_lock_context );
-
-  return needs_help;
 }
 
 static void test_case_yield_op(
@@ -349,7 +346,6 @@ static void test_case_yield_op(
   Scheduler_SMP_Node_state new_state
 )
 {
-  bool needs_help;
   Per_CPU_Control *cpu_self;
 
   cpu_self = _Thread_Dispatch_disable();
@@ -393,15 +389,12 @@ static void test_case_yield_op(
   }
   rtems_test_assert(executing_node->state == start_state);
 
-  needs_help = yield_op(executing, executing_node);
+  yield_op(executing, executing_node);
   rtems_test_assert(executing_node->state == new_state);
 
   switch (new_state) {
     case SCHEDULER_SMP_NODE_SCHEDULED:
-      rtems_test_assert(!needs_help);
-      break;
     case SCHEDULER_SMP_NODE_READY:
-      rtems_test_assert(needs_help);
       break;
     default:
       rtems_test_assert(0);
@@ -470,7 +463,7 @@ static void block_op(
   _Thread_State_release( thread, &state_lock_context );
 }
 
-static bool unblock_op(
+static void unblock_op(
   Thread_Control *thread,
   Scheduler_SMP_Node *scheduler_node
 )
@@ -478,13 +471,12 @@ static bool unblock_op(
   const Scheduler_Control *scheduler;
   ISR_lock_Context state_lock_context;
   ISR_lock_Context scheduler_lock_context;
-  bool needs_help;
 
   _Thread_State_acquire( thread, &state_lock_context );
   scheduler = _Thread_Scheduler_get_home( thread );
   _Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
 
-  needs_help = (*scheduler->Operations.unblock)(
+  (*scheduler->Operations.unblock)(
     scheduler,
     thread,
     &scheduler_node->Base
@@ -492,8 +484,6 @@ static bool unblock_op(
 
   _Scheduler_Release_critical( scheduler, &scheduler_lock_context );
   _Thread_State_release( thread, &state_lock_context );
-
-  return needs_help;
 }
 
 static void test_case_unblock_op(
@@ -503,7 +493,6 @@ static void test_case_unblock_op(
   Scheduler_SMP_Node_state new_state
 )
 {
-  bool needs_help;
   Per_CPU_Control *cpu_self;
 
   cpu_self = _Thread_Dispatch_disable();
@@ -525,15 +514,12 @@ static void test_case_unblock_op(
   block_op(executing, executing_node);
   rtems_test_assert(executing_node->state == SCHEDULER_SMP_NODE_BLOCKED);
 
-  needs_help = unblock_op(executing, executing_node);
+  unblock_op(executing, executing_node);
   rtems_test_assert(executing_node->state == new_state);
 
   switch (new_state) {
     case SCHEDULER_SMP_NODE_SCHEDULED:
-      rtems_test_assert(!needs_help);
-      break;
     case SCHEDULER_SMP_NODE_READY:
-      rtems_test_assert(needs_help);
       break;
     default:
       rtems_test_assert(0);




More information about the vc mailing list