Changeset 09c87fb in rtems


Ignore:
Timestamp:
Jun 30, 2016, 4:23:56 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
729cf694
Parents:
02987728
git-author:
Sebastian Huber <sebastian.huber@…> (06/30/16 04:23:56)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/30/16 07:51:18)
Message:

score: Strong APA scheduler processor allocation

Use _Scheduler_SMP_Allocate_processor_exact() to prevent unexpected
migrations.

Location:
cpukit/score
Files:
3 edited

Legend:

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

    r02987728 r09c87fb  
    486486    _Thread_Dispatch_update_heir( cpu_self, victim_cpu, heir );
    487487  }
     488}
     489
     490/*
     491 * This method is slightly different from
     492 * _Scheduler_SMP_Allocate_processor_lazy() in that it does what it is asked to
     493 * do.  _Scheduler_SMP_Allocate_processor_lazy() attempts to prevent migrations
     494 * but does not take into account affinity.
     495 */
     496static inline void _Scheduler_SMP_Allocate_processor_exact(
     497  Scheduler_Context *context,
     498  Thread_Control    *scheduled_thread,
     499  Thread_Control    *victim_thread
     500)
     501{
     502  Per_CPU_Control *victim_cpu = _Thread_Get_CPU( victim_thread );
     503  Per_CPU_Control *cpu_self = _Per_CPU_Get();
     504
     505  (void) context;
     506
     507  _Thread_Set_CPU( scheduled_thread, victim_cpu );
     508  _Thread_Dispatch_update_heir( cpu_self, victim_cpu, scheduled_thread );
    488509}
    489510
  • cpukit/score/src/schedulerpriorityaffinitysmp.c

    r02987728 r09c87fb  
    111111  node->Affinity     = *_CPU_set_Default();
    112112  node->Affinity.set = &node->Affinity.preallocated;
    113 }
    114 
    115 /*
    116  * This method is slightly different from
    117  * _Scheduler_SMP_Allocate_processor_lazy() in that it does what it is asked to
    118  * do. _Scheduler_SMP_Allocate_processor_lazy() attempts to prevent migrations
    119  * but does not take into account affinity.
    120  */
    121 static inline void _Scheduler_SMP_Allocate_processor_exact(
    122   Scheduler_Context *context,
    123   Thread_Control    *scheduled_thread,
    124   Thread_Control    *victim_thread
    125 )
    126 {
    127   Per_CPU_Control *victim_cpu = _Thread_Get_CPU( victim_thread );
    128   Per_CPU_Control *cpu_self = _Per_CPU_Get();
    129 
    130   (void) context;
    131 
    132   _Thread_Set_CPU( scheduled_thread, victim_cpu );
    133   _Thread_Dispatch_update_heir( cpu_self, victim_cpu, scheduled_thread );
    134113}
    135114
  • cpukit/score/src/schedulerstrongapa.c

    r02987728 r09c87fb  
    226226    _Scheduler_strong_APA_Get_highest_ready,
    227227    _Scheduler_strong_APA_Move_from_ready_to_scheduled,
    228     _Scheduler_SMP_Allocate_processor_lazy
     228    _Scheduler_SMP_Allocate_processor_exact
    229229  );
    230230}
     
    248248    _Scheduler_strong_APA_Move_from_scheduled_to_ready,
    249249    _Scheduler_SMP_Get_lowest_scheduled,
    250     _Scheduler_SMP_Allocate_processor_lazy
     250    _Scheduler_SMP_Allocate_processor_exact
    251251  );
    252252}
     
    301301    insert_scheduled,
    302302    _Scheduler_strong_APA_Move_from_ready_to_scheduled,
    303     _Scheduler_SMP_Allocate_processor_lazy
     303    _Scheduler_SMP_Allocate_processor_exact
    304304  );
    305305}
Note: See TracChangeset for help on using the changeset viewer.