Changeset 0e754fac in rtems


Ignore:
Timestamp:
Oct 21, 2016, 12:41:19 PM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
6771359f
Parents:
9c238e1
git-author:
Sebastian Huber <sebastian.huber@…> (10/21/16 12:41:19)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/02/16 09:05:44)
Message:

score: Delete unused scheduler ask for help X op

Location:
cpukit/score
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/scheduler.h

    r9c238e1 r0e754fac  
    148148    Scheduler_Node          *node,
    149149    Thread_Scheduler_state   next_state
    150   );
    151 
    152   /**
    153    * Ask for help operation.
    154    *
    155    * @param[in] scheduler The scheduler of the thread offering help.
    156    * @param[in] offers_help The thread offering help.
    157    * @param[in] needs_help The thread needing help.
    158    *
    159    * @retval needs_help It was not possible to schedule the thread needing
    160    *   help, so it is returned to continue the search for help.
    161    * @retval next_needs_help It was possible to schedule the thread needing
    162    *   help, but this displaced another thread eligible to ask for help.  So
    163    *   this thread is returned to start a new search for help.
    164    * @retval NULL It was possible to schedule the thread needing help, and no
    165    *   other thread needs help as a result.
    166    *
    167    * @see _Scheduler_Ask_for_help_X().
    168    */
    169   Thread_Control *( *ask_for_help_X )(
    170     const Scheduler_Control *scheduler,
    171     Thread_Control          *offers_help,
    172     Thread_Control          *needs_help
    173150  );
    174151#endif
     
    413390  );
    414391
    415   /**
    416    * @brief Does nothing.
    417    *
    418    * @param[in] scheduler Unused.
    419    * @param[in] offers_help Unused.
    420    * @param[in] needs_help Unused.
    421    *
    422    * @retval NULL Always.
    423    */
    424   Thread_Control *_Scheduler_default_Ask_for_help_X(
    425     const Scheduler_Control *scheduler,
    426     Thread_Control          *offers_help,
    427     Thread_Control          *needs_help
    428   );
    429 
    430392  #define SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP \
    431393    _Scheduler_default_Ask_for_help, \
    432394    _Scheduler_default_Reconsider_help_request, \
    433     _Scheduler_default_Withdraw_node, \
    434     _Scheduler_default_Ask_for_help_X,
     395    _Scheduler_default_Withdraw_node,
    435396#else
    436397  #define SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP
  • cpukit/score/include/rtems/score/schedulerimpl.h

    r9c238e1 r0e754fac  
    12981298  return unblock;
    12991299}
    1300 
    1301 /**
    1302  * @brief Asks a ready scheduler node for help.
    1303  *
    1304  * @param[in] node The ready node offering help.
    1305  * @param[in] needs_help The thread needing help.
    1306  *
    1307  * @retval needs_help The thread needing help.
    1308  */
    1309 RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Ask_ready_node_for_help(
    1310   Scheduler_Node *node,
    1311   Thread_Control *needs_help
    1312 )
    1313 {
    1314   _Scheduler_Node_set_user( node, needs_help );
    1315 
    1316   return needs_help;
    1317 }
    1318 
    1319 /**
    1320  * @brief Asks a scheduled scheduler node for help.
    1321  *
    1322  * @param[in] context The scheduler instance context.
    1323  * @param[in] node The scheduled node offering help.
    1324  * @param[in] offers_help The thread offering help.
    1325  * @param[in] needs_help The thread needing help.
    1326  * @param[in] previous_accepts_help The previous thread accepting help by this
    1327  *   scheduler node.
    1328  * @param[in] release_idle_thread Function to release an idle thread.
    1329  *
    1330  * @retval needs_help The previous thread accepting help by this scheduler node
    1331  *   which was displaced by the thread needing help.
    1332  * @retval NULL There are no more threads needing help.
    1333  */
    1334 RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_Ask_scheduled_node_for_help(
    1335   Scheduler_Context             *context,
    1336   Scheduler_Node                *node,
    1337   Thread_Control                *offers_help,
    1338   Thread_Control                *needs_help,
    1339   Thread_Control                *previous_accepts_help,
    1340   Scheduler_Release_idle_thread  release_idle_thread
    1341 )
    1342 {
    1343   Thread_Control *next_needs_help = NULL;
    1344   Thread_Control *old_user = NULL;
    1345   Thread_Control *new_user = NULL;
    1346 
    1347   if (
    1348     previous_accepts_help != needs_help
    1349       && _Scheduler_Thread_get_node( previous_accepts_help ) == node
    1350   ) {
    1351     Thread_Control *idle = _Scheduler_Release_idle_thread(
    1352       context,
    1353       node,
    1354       release_idle_thread
    1355     );
    1356 
    1357     if ( idle != NULL ) {
    1358       old_user = idle;
    1359     } else {
    1360       _Assert( _Scheduler_Node_get_user( node ) == previous_accepts_help );
    1361       old_user = previous_accepts_help;
    1362     }
    1363 
    1364     if ( needs_help->Scheduler.state == THREAD_SCHEDULER_READY ) {
    1365       new_user = needs_help;
    1366     } else {
    1367       _Assert(
    1368         node->help_state == SCHEDULER_HELP_ACTIVE_OWNER
    1369           || node->help_state == SCHEDULER_HELP_ACTIVE_RIVAL
    1370       );
    1371       _Assert( offers_help->Scheduler.node == offers_help->Scheduler.own_node );
    1372 
    1373       new_user = offers_help;
    1374     }
    1375 
    1376     if ( previous_accepts_help != offers_help ) {
    1377       next_needs_help = previous_accepts_help;
    1378     }
    1379   } else if ( needs_help->Scheduler.state == THREAD_SCHEDULER_READY ) {
    1380     Thread_Control *idle = _Scheduler_Release_idle_thread(
    1381       context,
    1382       node,
    1383       release_idle_thread
    1384     );
    1385 
    1386     if ( idle != NULL ) {
    1387       old_user = idle;
    1388     } else {
    1389       old_user = _Scheduler_Node_get_user( node );
    1390     }
    1391 
    1392     new_user = needs_help;
    1393   } else {
    1394     _Assert( needs_help->Scheduler.state == THREAD_SCHEDULER_SCHEDULED );
    1395   }
    1396 
    1397   if ( new_user != old_user ) {
    1398     Per_CPU_Control *cpu_self = _Per_CPU_Get();
    1399     Per_CPU_Control *cpu = _Thread_Get_CPU( old_user );
    1400 
    1401     _Scheduler_Thread_change_state( old_user, THREAD_SCHEDULER_READY );
    1402     _Scheduler_Thread_set_scheduler_and_node(
    1403       old_user,
    1404       _Thread_Scheduler_get_own_node( old_user ),
    1405       old_user
    1406     );
    1407 
    1408     _Scheduler_Thread_change_state( new_user, THREAD_SCHEDULER_SCHEDULED );
    1409     _Scheduler_Thread_set_scheduler_and_node( new_user, node, offers_help );
    1410 
    1411     _Scheduler_Node_set_user( node, new_user );
    1412     _Thread_Set_CPU( new_user, cpu );
    1413     _Thread_Dispatch_update_heir( cpu_self, cpu, new_user );
    1414   }
    1415 
    1416   return next_needs_help;
    1417 }
    1418 
    1419 /**
    1420  * @brief Asks a blocked scheduler node for help.
    1421  *
    1422  * @param[in] context The scheduler instance context.
    1423  * @param[in] node The scheduled node offering help.
    1424  * @param[in] offers_help The thread offering help.
    1425  * @param[in] needs_help The thread needing help.
    1426  *
    1427  * @retval true Enqueue this scheduler node.
    1428  * @retval false Otherwise.
    1429  */
    1430 RTEMS_INLINE_ROUTINE bool _Scheduler_Ask_blocked_node_for_help(
    1431   Scheduler_Context *context,
    1432   Scheduler_Node    *node,
    1433   Thread_Control    *offers_help,
    1434   Thread_Control    *needs_help
    1435 )
    1436 {
    1437   bool enqueue;
    1438 
    1439   _Assert( node->help_state == SCHEDULER_HELP_PASSIVE );
    1440 
    1441   if ( needs_help->Scheduler.state == THREAD_SCHEDULER_READY ) {
    1442     _Scheduler_Node_set_user( node, needs_help );
    1443     _Scheduler_Thread_set_scheduler_and_node( needs_help, node, offers_help );
    1444 
    1445     enqueue = true;
    1446   } else {
    1447     enqueue = false;
    1448   }
    1449 
    1450   return enqueue;
    1451 }
    14521300#endif
    14531301
  • cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h

    r9c238e1 r0e754fac  
    6161    _Scheduler_priority_affinity_SMP_Reconsider_help_request, \
    6262    _Scheduler_priority_affinity_SMP_Withdraw_node, \
    63     _Scheduler_priority_affinity_SMP_Ask_for_help_X, \
    6463    _Scheduler_priority_affinity_SMP_Node_initialize, \
    6564    _Scheduler_default_Node_destroy, \
     
    145144);
    146145
    147 Thread_Control *_Scheduler_priority_affinity_SMP_Ask_for_help_X(
    148   const Scheduler_Control *scheduler,
    149   Thread_Control          *offers_help,
    150   Thread_Control          *needs_help
    151 );
    152 
    153146/**
    154147 * @brief Set affinity for the priority affinity SMP scheduler.
  • cpukit/score/include/rtems/score/schedulerprioritysmp.h

    r9c238e1 r0e754fac  
    9090    _Scheduler_priority_SMP_Reconsider_help_request, \
    9191    _Scheduler_priority_SMP_Withdraw_node, \
    92     _Scheduler_priority_SMP_Ask_for_help_X, \
    9392    _Scheduler_priority_SMP_Node_initialize, \
    9493    _Scheduler_default_Node_destroy, \
     
    146145);
    147146
    148 Thread_Control *_Scheduler_priority_SMP_Ask_for_help_X(
    149   const Scheduler_Control *scheduler,
    150   Thread_Control          *needs_help,
    151   Thread_Control          *offers_help
    152 );
    153 
    154147Thread_Control *_Scheduler_priority_SMP_Yield(
    155148  const Scheduler_Control *scheduler,
  • cpukit/score/include/rtems/score/schedulersimplesmp.h

    r9c238e1 r0e754fac  
    7373    _Scheduler_simple_SMP_Reconsider_help_request, \
    7474    _Scheduler_simple_SMP_Withdraw_node, \
    75     _Scheduler_simple_SMP_Ask_for_help_X, \
    7675    _Scheduler_simple_SMP_Node_initialize, \
    7776    _Scheduler_default_Node_destroy, \
     
    129128);
    130129
    131 Thread_Control *_Scheduler_simple_SMP_Ask_for_help_X(
    132   const Scheduler_Control *scheduler,
    133   Thread_Control          *offers_help,
    134   Thread_Control          *needs_help
    135 );
    136 
    137130Thread_Control *_Scheduler_simple_SMP_Yield(
    138131  const Scheduler_Control *scheduler,
  • cpukit/score/include/rtems/score/schedulersmpimpl.h

    r9c238e1 r0e754fac  
    10701070}
    10711071
    1072 static inline Thread_Control *_Scheduler_SMP_Ask_for_help_X(
    1073   Scheduler_Context                  *context,
    1074   Thread_Control                     *offers_help,
    1075   Thread_Control                     *needs_help,
    1076   Scheduler_SMP_Enqueue               enqueue_fifo
    1077 )
    1078 {
    1079   Scheduler_SMP_Node *node = _Scheduler_SMP_Thread_get_own_node( offers_help );
    1080   Thread_Control *next_needs_help = NULL;
    1081   Thread_Control *previous_accepts_help;
    1082 
    1083   previous_accepts_help = node->Base.accepts_help;
    1084   node->Base.accepts_help = needs_help;
    1085 
    1086   switch ( node->state ) {
    1087     case SCHEDULER_SMP_NODE_READY:
    1088       next_needs_help =
    1089         _Scheduler_Ask_ready_node_for_help( &node->Base, needs_help );
    1090       break;
    1091     case SCHEDULER_SMP_NODE_SCHEDULED:
    1092       next_needs_help = _Scheduler_Ask_scheduled_node_for_help(
    1093         context,
    1094         &node->Base,
    1095         offers_help,
    1096         needs_help,
    1097         previous_accepts_help,
    1098         _Scheduler_SMP_Release_idle_thread
    1099       );
    1100       break;
    1101     case SCHEDULER_SMP_NODE_BLOCKED:
    1102       if (
    1103         _Scheduler_Ask_blocked_node_for_help(
    1104           context,
    1105           &node->Base,
    1106           offers_help,
    1107           needs_help
    1108         )
    1109       ) {
    1110         _Scheduler_SMP_Node_change_state(
    1111           &node->Base,
    1112           SCHEDULER_SMP_NODE_READY
    1113         );
    1114 
    1115         next_needs_help = ( *enqueue_fifo )(
    1116           context,
    1117           &node->Base,
    1118           needs_help
    1119         );
    1120       }
    1121       break;
    1122   }
    1123 
    1124   return next_needs_help;
    1125 }
    1126 
    11271072static inline Thread_Control *_Scheduler_SMP_Yield(
    11281073  Scheduler_Context               *context,
  • cpukit/score/include/rtems/score/schedulerstrongapa.h

    r9c238e1 r0e754fac  
    9090    _Scheduler_strong_APA_Reconsider_help_request, \
    9191    _Scheduler_strong_APA_Withdraw_node, \
    92     _Scheduler_strong_APA_Ask_for_help_X, \
    9392    _Scheduler_strong_APA_Node_initialize, \
    9493    _Scheduler_default_Node_destroy, \
     
    146145);
    147146
    148 Thread_Control *_Scheduler_strong_APA_Ask_for_help_X(
    149   const Scheduler_Control *scheduler,
    150   Thread_Control          *needs_help,
    151   Thread_Control          *offers_help
    152 );
    153 
    154147Thread_Control *_Scheduler_strong_APA_Yield(
    155148  const Scheduler_Control *scheduler,
  • cpukit/score/src/schedulerdefaultaskforhelp.c

    r9c238e1 r0e754fac  
    4949  (void) next_state;
    5050}
    51 
    52 Thread_Control *_Scheduler_default_Ask_for_help_X(
    53   const Scheduler_Control *scheduler,
    54   Thread_Control          *offers_help,
    55   Thread_Control          *needs_help
    56 )
    57 {
    58   (void) scheduler;
    59   (void) offers_help;
    60   (void) needs_help;
    61 
    62   return NULL;
    63 }
  • cpukit/score/src/schedulerpriorityaffinitysmp.c

    r9c238e1 r0e754fac  
    594594}
    595595
    596 Thread_Control *_Scheduler_priority_affinity_SMP_Ask_for_help_X(
    597   const Scheduler_Control *scheduler,
    598   Thread_Control          *offers_help,
    599   Thread_Control          *needs_help
    600 )
    601 {
    602   Scheduler_Context *context = _Scheduler_Get_context( scheduler );
    603 
    604   needs_help = _Scheduler_SMP_Ask_for_help_X(
    605     context,
    606     offers_help,
    607     needs_help,
    608     _Scheduler_priority_affinity_SMP_Enqueue_fifo
    609   );
    610 
    611   _Scheduler_priority_affinity_SMP_Check_for_migrations( context );
    612 
    613   return needs_help;
    614 }
    615 
    616596/*
    617597 * This is the public scheduler specific Change Priority operation.
  • cpukit/score/src/schedulerprioritysmp.c

    r9c238e1 r0e754fac  
    319319}
    320320
    321 Thread_Control *_Scheduler_priority_SMP_Ask_for_help_X(
    322   const Scheduler_Control *scheduler,
    323   Thread_Control          *offers_help,
    324   Thread_Control          *needs_help
    325 )
    326 {
    327   Scheduler_Context *context = _Scheduler_Get_context( scheduler );
    328 
    329   return _Scheduler_SMP_Ask_for_help_X(
    330     context,
    331     offers_help,
    332     needs_help,
    333     _Scheduler_priority_SMP_Enqueue_fifo
    334   );
    335 }
    336 
    337321Thread_Control *_Scheduler_priority_SMP_Yield(
    338322  const Scheduler_Control *scheduler,
  • cpukit/score/src/schedulersimplesmp.c

    r9c238e1 r0e754fac  
    386386}
    387387
    388 Thread_Control *_Scheduler_simple_SMP_Ask_for_help_X(
    389   const Scheduler_Control *scheduler,
    390   Thread_Control          *offers_help,
    391   Thread_Control          *needs_help
    392 )
    393 {
    394   Scheduler_Context *context = _Scheduler_Get_context( scheduler );
    395 
    396   return _Scheduler_SMP_Ask_for_help_X(
    397     context,
    398     offers_help,
    399     needs_help,
    400     _Scheduler_simple_SMP_Enqueue_fifo
    401   );
    402 }
    403 
    404388Thread_Control *_Scheduler_simple_SMP_Yield(
    405389  const Scheduler_Control *scheduler,
  • cpukit/score/src/schedulerstrongapa.c

    r9c238e1 r0e754fac  
    445445}
    446446
    447 Thread_Control *_Scheduler_strong_APA_Ask_for_help_X(
    448   const Scheduler_Control *scheduler,
    449   Thread_Control          *offers_help,
    450   Thread_Control          *needs_help
    451 )
    452 {
    453   Scheduler_Context *context = _Scheduler_Get_context( scheduler );
    454 
    455   return _Scheduler_SMP_Ask_for_help_X(
    456     context,
    457     offers_help,
    458     needs_help,
    459     _Scheduler_strong_APA_Enqueue_fifo
    460   );
    461 }
    462 
    463447Thread_Control *_Scheduler_strong_APA_Yield(
    464448  const Scheduler_Control *scheduler,
Note: See TracChangeset for help on using the changeset viewer.