Changeset ca1e546e in rtems for testsuites/smptests


Ignore:
Timestamp:
Feb 2, 2017, 3:24:05 PM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
bbfbfc8
Parents:
e2b1c47d
git-author:
Sebastian Huber <sebastian.huber@…> (02/02/17 15:24:05)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/03/17 09:17:38)
Message:

score: Improve scheduler helping protocol

Only register ask for help requests in the scheduler unblock and yield
operations. The actual ask for help operation is carried out during
_Thread_Do_dispatch() on a processor related to the thread. This yields
a better separation of scheduler instances. A thread of one scheduler
instance should not be forced to carry out too much work for threads on
other scheduler instances.

Update #2556.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/smptests/smpscheduler03/init.c

    re2b1c47d rca1e546e  
    316316}
    317317
    318 static bool yield_op(
     318static void yield_op(
    319319  Thread_Control *thread,
    320320  Scheduler_SMP_Node *scheduler_node
     
    324324  ISR_lock_Context state_lock_context;
    325325  ISR_lock_Context scheduler_lock_context;
    326   bool needs_help;
    327326
    328327  _Thread_State_acquire( thread, &state_lock_context );
     
    330329  _Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
    331330
    332   needs_help = (*scheduler->Operations.yield)(
     331  (*scheduler->Operations.yield)(
    333332    scheduler,
    334333    thread,
     
    338337  _Scheduler_Release_critical( scheduler, &scheduler_lock_context );
    339338  _Thread_State_release( thread, &state_lock_context );
    340 
    341   return needs_help;
    342339}
    343340
     
    350347)
    351348{
    352   bool needs_help;
    353349  Per_CPU_Control *cpu_self;
    354350
     
    394390  rtems_test_assert(executing_node->state == start_state);
    395391
    396   needs_help = yield_op(executing, executing_node);
     392  yield_op(executing, executing_node);
    397393  rtems_test_assert(executing_node->state == new_state);
    398394
    399395  switch (new_state) {
    400396    case SCHEDULER_SMP_NODE_SCHEDULED:
    401       rtems_test_assert(!needs_help);
    402       break;
    403397    case SCHEDULER_SMP_NODE_READY:
    404       rtems_test_assert(needs_help);
    405398      break;
    406399    default:
     
    471464}
    472465
    473 static bool unblock_op(
     466static void unblock_op(
    474467  Thread_Control *thread,
    475468  Scheduler_SMP_Node *scheduler_node
     
    479472  ISR_lock_Context state_lock_context;
    480473  ISR_lock_Context scheduler_lock_context;
    481   bool needs_help;
    482474
    483475  _Thread_State_acquire( thread, &state_lock_context );
     
    485477  _Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
    486478
    487   needs_help = (*scheduler->Operations.unblock)(
     479  (*scheduler->Operations.unblock)(
    488480    scheduler,
    489481    thread,
     
    493485  _Scheduler_Release_critical( scheduler, &scheduler_lock_context );
    494486  _Thread_State_release( thread, &state_lock_context );
    495 
    496   return needs_help;
    497487}
    498488
     
    504494)
    505495{
    506   bool needs_help;
    507496  Per_CPU_Control *cpu_self;
    508497
     
    526515  rtems_test_assert(executing_node->state == SCHEDULER_SMP_NODE_BLOCKED);
    527516
    528   needs_help = unblock_op(executing, executing_node);
     517  unblock_op(executing, executing_node);
    529518  rtems_test_assert(executing_node->state == new_state);
    530519
    531520  switch (new_state) {
    532521    case SCHEDULER_SMP_NODE_SCHEDULED:
    533       rtems_test_assert(!needs_help);
    534       break;
    535522    case SCHEDULER_SMP_NODE_READY:
    536       rtems_test_assert(needs_help);
    537523      break;
    538524    default:
Note: See TracChangeset for help on using the changeset viewer.