Changeset 4edcede in rtems


Ignore:
Timestamp:
Oct 27, 2017, 7:03:31 AM (19 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
1d572eba
Parents:
6d85e05
git-author:
Sebastian Huber <sebastian.huber@…> (10/27/17 07:03:31)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/28/17 11:08:53)
Message:

score: Simplify SMP get lowest scheduled

There is no need to pass in the order relation since the scheduled
threads reside on an already ordered chain. The caller will decide what
to do with the lowest scheduled thread.

Location:
cpukit/score
Files:
3 edited

Legend:

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

    r6d85e05 r4edcede  
    287287typedef Scheduler_Node *( *Scheduler_SMP_Get_lowest_scheduled )(
    288288  Scheduler_Context *context,
    289   Scheduler_Node    *filter,
    290   Chain_Node_order   order
     289  Scheduler_Node    *filter
    291290);
    292291
     
    616615static inline Scheduler_Node *_Scheduler_SMP_Get_lowest_scheduled(
    617616  Scheduler_Context *context,
    618   Scheduler_Node    *filter,
    619   Chain_Node_order   order
     617  Scheduler_Node    *filter
    620618)
    621619{
     
    626624
    627625  (void) filter;
    628   (void) order;
    629626
    630627  _Assert( &lowest_scheduled->Node.Chain != _Chain_Tail( scheduled ) );
     
    726723  Scheduler_Node *lowest_scheduled;
    727724
    728   lowest_scheduled = ( *get_lowest_scheduled )( context, node, order );
     725  lowest_scheduled = ( *get_lowest_scheduled )( context, node );
    729726
    730727  if ( ( *order )( &node->Node.Chain, &lowest_scheduled->Node.Chain ) ) {
     
    12081205  bool              success;
    12091206
    1210   lowest_scheduled = ( *get_lowest_scheduled )( context, node, order );
     1207  lowest_scheduled = ( *get_lowest_scheduled )( context, node );
    12111208
    12121209  _Thread_Scheduler_acquire_critical( thread, &lock_context );
  • cpukit/score/src/scheduleredfsmp.c

    r6d85e05 r4edcede  
    227227static inline Scheduler_Node *_Scheduler_EDF_SMP_Get_lowest_scheduled(
    228228  Scheduler_Context *context,
    229   Scheduler_Node    *filter_base,
    230   Chain_Node_order   order
     229  Scheduler_Node    *filter_base
    231230)
    232231{
     
    250249  }
    251250
    252   return _Scheduler_SMP_Get_lowest_scheduled( context, filter_base, order );
     251  return _Scheduler_SMP_Get_lowest_scheduled( context, filter_base );
    253252}
    254253
  • cpukit/score/src/schedulerpriorityaffinitysmp.c

    r6d85e05 r4edcede  
    211211static Scheduler_Node * _Scheduler_priority_affinity_SMP_Get_lowest_scheduled(
    212212  Scheduler_Context *context,
    213   Scheduler_Node    *filter_base,
    214   Chain_Node_order   order
     213  Scheduler_Node    *filter_base
    215214)
    216215{
     
    231230    node = (Scheduler_priority_affinity_SMP_Node *) chain_node;
    232231
    233     /*
    234      * If we didn't find a thread which is of equal or lower importance
    235      * than filter thread is, then we can't schedule the filter thread
    236      * to execute.
    237      */
    238     if (
    239       (*order)(
    240         &node->Base.Base.Base.Node.Chain,
    241         &filter->Base.Base.Base.Node.Chain
    242       )
    243     ) {
    244       break;
    245     }
    246 
    247232    /* cpu_index is the processor number thread is executing on */
    248233    thread = _Scheduler_Node_get_owner( &node->Base.Base.Base );
     
    310295      _Scheduler_priority_affinity_SMP_Get_lowest_scheduled(
    311296        context,
    312         highest_ready,
    313         _Scheduler_SMP_Insert_priority_lifo_order
     297        highest_ready
    314298      );
    315299
     
    323307     * affinity as we look to place it.
    324308     */
     309
    325310    if ( lowest_scheduled == NULL )
    326311      break;
     312
     313    if (
     314      _Scheduler_SMP_Insert_priority_lifo_order(
     315        &lowest_scheduled->Node.Chain,
     316        &highest_ready->Node.Chain
     317      )
     318    ) {
     319      break;
     320    }
    327321
    328322    /*
Note: See TracChangeset for help on using the changeset viewer.