Changeset d5ef7ae2 in rtems


Ignore:
Timestamp:
Jun 14, 2013, 7:14:31 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
f346bcf7
Parents:
3f317e9
git-author:
Sebastian Huber <sebastian.huber@…> (06/14/13 07:14:31)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/30/13 07:53:25)
Message:

smp: Delete _SMP_Request_other_cores_to_dispatch()

Use an event triggered unicast to inform remote processors about a
necessary thread dispatch instead.

Location:
cpukit/score
Files:
7 edited

Legend:

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

    r3f317e9 rd5ef7ae2  
    9797
    9898/**
    99  *  @brief Request dispatch on other cores.
    100  *
    101  *  Send message to other cores requesting them to perform
    102  *  a thread dispatch operation.
    103  */
    104 void _SMP_Request_other_cores_to_dispatch(void);
    105 
    106 /**
    10799 *  @brief Request other cores to shutdown.
    108100 *
  • cpukit/score/include/rtems/score/threadimpl.h

    r3f317e9 rd5ef7ae2  
    635635RTEMS_INLINE_ROUTINE void _Thread_Signal_notification( Thread_Control *thread )
    636636{
    637   if ( _ISR_Is_in_progress() && _Thread_Is_executing( thread ) )
     637  if ( _ISR_Is_in_progress() && _Thread_Is_executing( thread ) ) {
    638638    _Thread_Dispatch_necessary = true;
     639  } else {
     640#if defined(RTEMS_SMP)
     641    if ( thread->is_executing ) {
     642      const Per_CPU_Control *cpu_of_executing = _Per_CPU_Get();
     643      Per_CPU_Control *cpu_of_thread = thread->cpu;
     644
     645      if ( cpu_of_executing != cpu_of_thread ) {
     646        cpu_of_thread->dispatch_necessary = true;
     647        _Per_CPU_Send_interrupt( cpu_of_thread );
     648      }
     649    }
     650#endif
     651  }
    639652}
    640653
  • cpukit/score/src/isrsmp.c

    r3f317e9 rd5ef7ae2  
    7373  _Thread_Dispatch_decrement_disable_level();
    7474
    75    if ( retval == 0 )
    76     _SMP_Request_other_cores_to_dispatch();
    77 
    7875  return retval;
    7976}
  • cpukit/score/src/schedulersimplesmp.c

    r3f317e9 rd5ef7ae2  
    5959
    6060  if ( heir != victim ) {
     61    const Per_CPU_Control *cpu_of_executing = _Per_CPU_Get();
     62
    6163    heir->cpu = cpu_of_victim;
    6264    cpu_of_victim->heir = heir;
    6365    cpu_of_victim->dispatch_necessary = true;
     66
     67    if ( cpu_of_victim != cpu_of_executing ) {
     68      _Per_CPU_Send_interrupt( cpu_of_victim );
     69    }
    6470  }
    6571}
  • cpukit/score/src/smp.c

    r3f317e9 rd5ef7ae2  
    166166}
    167167
    168 void _SMP_Request_other_cores_to_dispatch( void )
    169 {
    170   if ( _System_state_Is_up( _System_state_Get() ) ) {
    171     uint32_t self = _SMP_Get_current_processor();
    172     uint32_t ncpus = _SMP_Get_processor_count();
    173     uint32_t cpu;
    174 
    175     for ( cpu = 0 ; cpu < ncpus ; ++cpu ) {
    176       const Per_CPU_Control *per_cpu = &_Per_CPU_Information[ cpu ];
    177 
    178       if (
    179         cpu != self
    180           && per_cpu->state == PER_CPU_STATE_UP
    181           && per_cpu->dispatch_necessary
    182       ) {
    183         _SMP_Send_message( cpu, 0 );
    184       }
    185     }
    186   }
    187 }
    188 
    189168void _SMP_Request_other_cores_to_shutdown( void )
    190169{
  • cpukit/score/src/threaddispatch.c

    r3f317e9 rd5ef7ae2  
    6666     */
    6767    _Thread_Disable_dispatch();
    68 
    69     /*
    70      *  If necessary, send dispatch request to other cores.
    71      */
    72     _SMP_Request_other_cores_to_dispatch();
    7368  #else
    7469    _Thread_Dispatch_set_disable_level( 1 );
  • cpukit/score/src/threadinitialize.c

    r3f317e9 rd5ef7ae2  
    182182  the_thread->is_scheduled            = false;
    183183  the_thread->is_executing            = false;
    184   the_thread->cpu                     = NULL;
     184
     185  /* Initialize the cpu field for the non-SMP schedulers */
     186  the_thread->cpu                     = _Per_CPU_Get_by_index( 0 );
    185187#endif
    186188
Note: See TracChangeset for help on using the changeset viewer.