[PATCH 23/30] score: Delete unused scheduler ask for help X op

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Oct 31 08:51:54 UTC 2016


---
 cpukit/score/include/rtems/score/scheduler.h       |  41 +-----
 cpukit/score/include/rtems/score/schedulerimpl.h   | 152 ---------------------
 .../rtems/score/schedulerpriorityaffinitysmp.h     |   7 -
 .../include/rtems/score/schedulerprioritysmp.h     |   7 -
 .../score/include/rtems/score/schedulersimplesmp.h |   7 -
 .../score/include/rtems/score/schedulersmpimpl.h   |  55 --------
 .../score/include/rtems/score/schedulerstrongapa.h |   7 -
 cpukit/score/src/schedulerdefaultaskforhelp.c      |  13 --
 cpukit/score/src/schedulerpriorityaffinitysmp.c    |  20 ---
 cpukit/score/src/schedulerprioritysmp.c            |  16 ---
 cpukit/score/src/schedulersimplesmp.c              |  16 ---
 cpukit/score/src/schedulerstrongapa.c              |  16 ---
 12 files changed, 1 insertion(+), 356 deletions(-)

diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h
index a8afcd0..c34ceed 100644
--- a/cpukit/score/include/rtems/score/scheduler.h
+++ b/cpukit/score/include/rtems/score/scheduler.h
@@ -148,29 +148,6 @@ typedef struct {
     Scheduler_Node          *node,
     Thread_Scheduler_state   next_state
   );
-
-  /**
-   * Ask for help operation.
-   *
-   * @param[in] scheduler The scheduler of the thread offering help.
-   * @param[in] offers_help The thread offering help.
-   * @param[in] needs_help The thread needing help.
-   *
-   * @retval needs_help It was not possible to schedule the thread needing
-   *   help, so it is returned to continue the search for help.
-   * @retval next_needs_help It was possible to schedule the thread needing
-   *   help, but this displaced another thread eligible to ask for help.  So
-   *   this thread is returned to start a new search for help.
-   * @retval NULL It was possible to schedule the thread needing help, and no
-   *   other thread needs help as a result.
-   *
-   * @see _Scheduler_Ask_for_help_X().
-   */
-  Thread_Control *( *ask_for_help_X )(
-    const Scheduler_Control *scheduler,
-    Thread_Control          *offers_help,
-    Thread_Control          *needs_help
-  );
 #endif
 
   /** @see _Scheduler_Node_initialize() */
@@ -412,26 +389,10 @@ Priority_Control _Scheduler_default_Map_priority(
     Thread_Scheduler_state   next_state
   );
 
-  /**
-   * @brief Does nothing.
-   *
-   * @param[in] scheduler Unused.
-   * @param[in] offers_help Unused.
-   * @param[in] needs_help Unused.
-   *
-   * @retval NULL Always.
-   */
-  Thread_Control *_Scheduler_default_Ask_for_help_X(
-    const Scheduler_Control *scheduler,
-    Thread_Control          *offers_help,
-    Thread_Control          *needs_help
-  );
-
   #define SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP \
     _Scheduler_default_Ask_for_help, \
     _Scheduler_default_Reconsider_help_request, \
-    _Scheduler_default_Withdraw_node, \
-    _Scheduler_default_Ask_for_help_X,
+    _Scheduler_default_Withdraw_node,
 #else
   #define SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP
 #endif
diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h
index 74cfb58..54ddd53 100644
--- a/cpukit/score/include/rtems/score/schedulerimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerimpl.h
@@ -1297,158 +1297,6 @@ RTEMS_INLINE_ROUTINE bool _Scheduler_Unblock_node(
 
   return unblock;
 }
-
-/**
- * @brief Asks a ready scheduler node for help.
- *
- * @param[in] node The ready node offering help.
- * @param[in] needs_help The thread needing help.
- *
- * @retval needs_help The thread needing help.
- */
-RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Ask_ready_node_for_help(
-  Scheduler_Node *node,
-  Thread_Control *needs_help
-)
-{
-  _Scheduler_Node_set_user( node, needs_help );
-
-  return needs_help;
-}
-
-/**
- * @brief Asks a scheduled scheduler node for help.
- *
- * @param[in] context The scheduler instance context.
- * @param[in] node The scheduled node offering help.
- * @param[in] offers_help The thread offering help.
- * @param[in] needs_help The thread needing help.
- * @param[in] previous_accepts_help The previous thread accepting help by this
- *   scheduler node.
- * @param[in] release_idle_thread Function to release an idle thread.
- *
- * @retval needs_help The previous thread accepting help by this scheduler node
- *   which was displaced by the thread needing help.
- * @retval NULL There are no more threads needing help.
- */
-RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Ask_scheduled_node_for_help(
-  Scheduler_Context             *context,
-  Scheduler_Node                *node,
-  Thread_Control                *offers_help,
-  Thread_Control                *needs_help,
-  Thread_Control                *previous_accepts_help,
-  Scheduler_Release_idle_thread  release_idle_thread
-)
-{
-  Thread_Control *next_needs_help = NULL;
-  Thread_Control *old_user = NULL;
-  Thread_Control *new_user = NULL;
-
-  if (
-    previous_accepts_help != needs_help
-      && _Scheduler_Thread_get_node( previous_accepts_help ) == node
-  ) {
-    Thread_Control *idle = _Scheduler_Release_idle_thread(
-      context,
-      node,
-      release_idle_thread
-    );
-
-    if ( idle != NULL ) {
-      old_user = idle;
-    } else {
-      _Assert( _Scheduler_Node_get_user( node ) == previous_accepts_help );
-      old_user = previous_accepts_help;
-    }
-
-    if ( needs_help->Scheduler.state == THREAD_SCHEDULER_READY ) {
-      new_user = needs_help;
-    } else {
-      _Assert(
-        node->help_state == SCHEDULER_HELP_ACTIVE_OWNER
-          || node->help_state == SCHEDULER_HELP_ACTIVE_RIVAL
-      );
-      _Assert( offers_help->Scheduler.node == offers_help->Scheduler.own_node );
-
-      new_user = offers_help;
-    }
-
-    if ( previous_accepts_help != offers_help ) {
-      next_needs_help = previous_accepts_help;
-    }
-  } else if ( needs_help->Scheduler.state == THREAD_SCHEDULER_READY ) {
-    Thread_Control *idle = _Scheduler_Release_idle_thread(
-      context,
-      node,
-      release_idle_thread
-    );
-
-    if ( idle != NULL ) {
-      old_user = idle;
-    } else {
-      old_user = _Scheduler_Node_get_user( node );
-    }
-
-    new_user = needs_help;
-  } else {
-    _Assert( needs_help->Scheduler.state == THREAD_SCHEDULER_SCHEDULED );
-  }
-
-  if ( new_user != old_user ) {
-    Per_CPU_Control *cpu_self = _Per_CPU_Get();
-    Per_CPU_Control *cpu = _Thread_Get_CPU( old_user );
-
-    _Scheduler_Thread_change_state( old_user, THREAD_SCHEDULER_READY );
-    _Scheduler_Thread_set_scheduler_and_node(
-      old_user,
-      _Thread_Scheduler_get_own_node( old_user ),
-      old_user
-    );
-
-    _Scheduler_Thread_change_state( new_user, THREAD_SCHEDULER_SCHEDULED );
-    _Scheduler_Thread_set_scheduler_and_node( new_user, node, offers_help );
-
-    _Scheduler_Node_set_user( node, new_user );
-    _Thread_Set_CPU( new_user, cpu );
-    _Thread_Dispatch_update_heir( cpu_self, cpu, new_user );
-  }
-
-  return next_needs_help;
-}
-
-/**
- * @brief Asks a blocked scheduler node for help.
- *
- * @param[in] context The scheduler instance context.
- * @param[in] node The scheduled node offering help.
- * @param[in] offers_help The thread offering help.
- * @param[in] needs_help The thread needing help.
- *
- * @retval true Enqueue this scheduler node.
- * @retval false Otherwise.
- */
-RTEMS_INLINE_ROUTINE bool _Scheduler_Ask_blocked_node_for_help(
-  Scheduler_Context *context,
-  Scheduler_Node    *node,
-  Thread_Control    *offers_help,
-  Thread_Control    *needs_help
-)
-{
-  bool enqueue;
-
-  _Assert( node->help_state == SCHEDULER_HELP_PASSIVE );
-
-  if ( needs_help->Scheduler.state == THREAD_SCHEDULER_READY ) {
-    _Scheduler_Node_set_user( node, needs_help );
-    _Scheduler_Thread_set_scheduler_and_node( needs_help, node, offers_help );
-
-    enqueue = true;
-  } else {
-    enqueue = false;
-  }
-
-  return enqueue;
-}
 #endif
 
 RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir(
diff --git a/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h b/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h
index dceac92..73f985c 100644
--- a/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h
+++ b/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h
@@ -60,7 +60,6 @@ extern "C" {
     _Scheduler_priority_affinity_SMP_Ask_for_help, \
     _Scheduler_priority_affinity_SMP_Reconsider_help_request, \
     _Scheduler_priority_affinity_SMP_Withdraw_node, \
-    _Scheduler_priority_affinity_SMP_Ask_for_help_X, \
     _Scheduler_priority_affinity_SMP_Node_initialize, \
     _Scheduler_default_Node_destroy, \
     _Scheduler_default_Release_job, \
@@ -144,12 +143,6 @@ void _Scheduler_priority_affinity_SMP_Withdraw_node(
   Thread_Scheduler_state   next_state
 );
 
-Thread_Control *_Scheduler_priority_affinity_SMP_Ask_for_help_X(
-  const Scheduler_Control *scheduler,
-  Thread_Control          *offers_help,
-  Thread_Control          *needs_help
-);
-
 /** 
  * @brief Set affinity for the priority affinity SMP scheduler.
  *
diff --git a/cpukit/score/include/rtems/score/schedulerprioritysmp.h b/cpukit/score/include/rtems/score/schedulerprioritysmp.h
index 90c4566..da0dc06 100644
--- a/cpukit/score/include/rtems/score/schedulerprioritysmp.h
+++ b/cpukit/score/include/rtems/score/schedulerprioritysmp.h
@@ -89,7 +89,6 @@ typedef struct {
     _Scheduler_priority_SMP_Ask_for_help, \
     _Scheduler_priority_SMP_Reconsider_help_request, \
     _Scheduler_priority_SMP_Withdraw_node, \
-    _Scheduler_priority_SMP_Ask_for_help_X, \
     _Scheduler_priority_SMP_Node_initialize, \
     _Scheduler_default_Node_destroy, \
     _Scheduler_default_Release_job, \
@@ -145,12 +144,6 @@ void _Scheduler_priority_SMP_Withdraw_node(
   Thread_Scheduler_state   next_state
 );
 
-Thread_Control *_Scheduler_priority_SMP_Ask_for_help_X(
-  const Scheduler_Control *scheduler,
-  Thread_Control          *needs_help,
-  Thread_Control          *offers_help
-);
-
 Thread_Control *_Scheduler_priority_SMP_Yield(
   const Scheduler_Control *scheduler,
   Thread_Control          *thread,
diff --git a/cpukit/score/include/rtems/score/schedulersimplesmp.h b/cpukit/score/include/rtems/score/schedulersimplesmp.h
index 76037dd..a0331fb 100644
--- a/cpukit/score/include/rtems/score/schedulersimplesmp.h
+++ b/cpukit/score/include/rtems/score/schedulersimplesmp.h
@@ -72,7 +72,6 @@ typedef struct {
     _Scheduler_simple_SMP_Ask_for_help, \
     _Scheduler_simple_SMP_Reconsider_help_request, \
     _Scheduler_simple_SMP_Withdraw_node, \
-    _Scheduler_simple_SMP_Ask_for_help_X, \
     _Scheduler_simple_SMP_Node_initialize, \
     _Scheduler_default_Node_destroy, \
     _Scheduler_default_Release_job, \
@@ -128,12 +127,6 @@ void _Scheduler_simple_SMP_Withdraw_node(
   Thread_Scheduler_state   next_state
 );
 
-Thread_Control *_Scheduler_simple_SMP_Ask_for_help_X(
-  const Scheduler_Control *scheduler,
-  Thread_Control          *offers_help,
-  Thread_Control          *needs_help
-);
-
 Thread_Control *_Scheduler_simple_SMP_Yield(
   const Scheduler_Control *scheduler,
   Thread_Control          *thread,
diff --git a/cpukit/score/include/rtems/score/schedulersmpimpl.h b/cpukit/score/include/rtems/score/schedulersmpimpl.h
index 0846d49..6c3a409 100644
--- a/cpukit/score/include/rtems/score/schedulersmpimpl.h
+++ b/cpukit/score/include/rtems/score/schedulersmpimpl.h
@@ -1069,61 +1069,6 @@ static inline void _Scheduler_SMP_Update_priority(
   }
 }
 
-static inline Thread_Control *_Scheduler_SMP_Ask_for_help_X(
-  Scheduler_Context                  *context,
-  Thread_Control                     *offers_help,
-  Thread_Control                     *needs_help,
-  Scheduler_SMP_Enqueue               enqueue_fifo
-)
-{
-  Scheduler_SMP_Node *node = _Scheduler_SMP_Thread_get_own_node( offers_help );
-  Thread_Control *next_needs_help = NULL;
-  Thread_Control *previous_accepts_help;
-
-  previous_accepts_help = node->Base.accepts_help;
-  node->Base.accepts_help = needs_help;
-
-  switch ( node->state ) {
-    case SCHEDULER_SMP_NODE_READY:
-      next_needs_help =
-        _Scheduler_Ask_ready_node_for_help( &node->Base, needs_help );
-      break;
-    case SCHEDULER_SMP_NODE_SCHEDULED:
-      next_needs_help = _Scheduler_Ask_scheduled_node_for_help(
-        context,
-        &node->Base,
-        offers_help,
-        needs_help,
-        previous_accepts_help,
-        _Scheduler_SMP_Release_idle_thread
-      );
-      break;
-    case SCHEDULER_SMP_NODE_BLOCKED:
-      if (
-        _Scheduler_Ask_blocked_node_for_help(
-          context,
-          &node->Base,
-          offers_help,
-          needs_help
-        )
-      ) {
-        _Scheduler_SMP_Node_change_state(
-          &node->Base,
-          SCHEDULER_SMP_NODE_READY
-        );
-
-        next_needs_help = ( *enqueue_fifo )(
-          context,
-          &node->Base,
-          needs_help
-        );
-      }
-      break;
-  }
-
-  return next_needs_help;
-}
-
 static inline Thread_Control *_Scheduler_SMP_Yield(
   Scheduler_Context               *context,
   Thread_Control                  *thread,
diff --git a/cpukit/score/include/rtems/score/schedulerstrongapa.h b/cpukit/score/include/rtems/score/schedulerstrongapa.h
index 1b8418b..40a6675 100644
--- a/cpukit/score/include/rtems/score/schedulerstrongapa.h
+++ b/cpukit/score/include/rtems/score/schedulerstrongapa.h
@@ -89,7 +89,6 @@ typedef struct {
     _Scheduler_strong_APA_Ask_for_help, \
     _Scheduler_strong_APA_Reconsider_help_request, \
     _Scheduler_strong_APA_Withdraw_node, \
-    _Scheduler_strong_APA_Ask_for_help_X, \
     _Scheduler_strong_APA_Node_initialize, \
     _Scheduler_default_Node_destroy, \
     _Scheduler_default_Release_job, \
@@ -145,12 +144,6 @@ void _Scheduler_strong_APA_Withdraw_node(
   Thread_Scheduler_state   next_state
 );
 
-Thread_Control *_Scheduler_strong_APA_Ask_for_help_X(
-  const Scheduler_Control *scheduler,
-  Thread_Control          *needs_help,
-  Thread_Control          *offers_help
-);
-
 Thread_Control *_Scheduler_strong_APA_Yield(
   const Scheduler_Control *scheduler,
   Thread_Control          *the_thread,
diff --git a/cpukit/score/src/schedulerdefaultaskforhelp.c b/cpukit/score/src/schedulerdefaultaskforhelp.c
index 9219a02..94ec2e2 100644
--- a/cpukit/score/src/schedulerdefaultaskforhelp.c
+++ b/cpukit/score/src/schedulerdefaultaskforhelp.c
@@ -48,16 +48,3 @@ void _Scheduler_default_Withdraw_node(
   (void) node;
   (void) next_state;
 }
-
-Thread_Control *_Scheduler_default_Ask_for_help_X(
-  const Scheduler_Control *scheduler,
-  Thread_Control          *offers_help,
-  Thread_Control          *needs_help
-)
-{
-  (void) scheduler;
-  (void) offers_help;
-  (void) needs_help;
-
-  return NULL;
-}
diff --git a/cpukit/score/src/schedulerpriorityaffinitysmp.c b/cpukit/score/src/schedulerpriorityaffinitysmp.c
index c1cc5be..91f9c3b 100644
--- a/cpukit/score/src/schedulerpriorityaffinitysmp.c
+++ b/cpukit/score/src/schedulerpriorityaffinitysmp.c
@@ -593,26 +593,6 @@ void _Scheduler_priority_affinity_SMP_Withdraw_node(
   );
 }
 
-Thread_Control *_Scheduler_priority_affinity_SMP_Ask_for_help_X(
-  const Scheduler_Control *scheduler,
-  Thread_Control          *offers_help,
-  Thread_Control          *needs_help
-)
-{
-  Scheduler_Context *context = _Scheduler_Get_context( scheduler );
-
-  needs_help = _Scheduler_SMP_Ask_for_help_X(
-    context,
-    offers_help,
-    needs_help,
-    _Scheduler_priority_affinity_SMP_Enqueue_fifo
-  );
-
-  _Scheduler_priority_affinity_SMP_Check_for_migrations( context );
-
-  return needs_help;
-}
-
 /*
  * This is the public scheduler specific Change Priority operation.
  */
diff --git a/cpukit/score/src/schedulerprioritysmp.c b/cpukit/score/src/schedulerprioritysmp.c
index 4b8398a..fac2b6d 100644
--- a/cpukit/score/src/schedulerprioritysmp.c
+++ b/cpukit/score/src/schedulerprioritysmp.c
@@ -318,22 +318,6 @@ void _Scheduler_priority_SMP_Withdraw_node(
   );
 }
 
-Thread_Control *_Scheduler_priority_SMP_Ask_for_help_X(
-  const Scheduler_Control *scheduler,
-  Thread_Control          *offers_help,
-  Thread_Control          *needs_help
-)
-{
-  Scheduler_Context *context = _Scheduler_Get_context( scheduler );
-
-  return _Scheduler_SMP_Ask_for_help_X(
-    context,
-    offers_help,
-    needs_help,
-    _Scheduler_priority_SMP_Enqueue_fifo
-  );
-}
-
 Thread_Control *_Scheduler_priority_SMP_Yield(
   const Scheduler_Control *scheduler,
   Thread_Control          *thread,
diff --git a/cpukit/score/src/schedulersimplesmp.c b/cpukit/score/src/schedulersimplesmp.c
index ff43c8a..ed2d5d1 100644
--- a/cpukit/score/src/schedulersimplesmp.c
+++ b/cpukit/score/src/schedulersimplesmp.c
@@ -385,22 +385,6 @@ void _Scheduler_simple_SMP_Withdraw_node(
   );
 }
 
-Thread_Control *_Scheduler_simple_SMP_Ask_for_help_X(
-  const Scheduler_Control *scheduler,
-  Thread_Control          *offers_help,
-  Thread_Control          *needs_help
-)
-{
-  Scheduler_Context *context = _Scheduler_Get_context( scheduler );
-
-  return _Scheduler_SMP_Ask_for_help_X(
-    context,
-    offers_help,
-    needs_help,
-    _Scheduler_simple_SMP_Enqueue_fifo
-  );
-}
-
 Thread_Control *_Scheduler_simple_SMP_Yield(
   const Scheduler_Control *scheduler,
   Thread_Control          *thread,
diff --git a/cpukit/score/src/schedulerstrongapa.c b/cpukit/score/src/schedulerstrongapa.c
index 1fc9b52..fce4541 100644
--- a/cpukit/score/src/schedulerstrongapa.c
+++ b/cpukit/score/src/schedulerstrongapa.c
@@ -444,22 +444,6 @@ void _Scheduler_strong_APA_Withdraw_node(
   );
 }
 
-Thread_Control *_Scheduler_strong_APA_Ask_for_help_X(
-  const Scheduler_Control *scheduler,
-  Thread_Control          *offers_help,
-  Thread_Control          *needs_help
-)
-{
-  Scheduler_Context *context = _Scheduler_Get_context( scheduler );
-
-  return _Scheduler_SMP_Ask_for_help_X(
-    context,
-    offers_help,
-    needs_help,
-    _Scheduler_strong_APA_Enqueue_fifo
-  );
-}
-
 Thread_Control *_Scheduler_strong_APA_Yield(
   const Scheduler_Control *scheduler,
   Thread_Control          *the_thread,
-- 
1.8.4.5




More information about the devel mailing list