Changeset 300f6a48 in rtems for testsuites/smptests


Ignore:
Timestamp:
Jun 22, 2016, 3:09:23 PM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
5d6b211
Parents:
8c83cbc
git-author:
Sebastian Huber <sebastian.huber@…> (06/22/16 15:09:23)
git-committer:
Sebastian Huber <sebastian.huber@…> (09/21/16 06:59:26)
Message:

score: Rework thread priority management

Add priority nodes which contribute to the overall thread priority.

The actual priority of a thread is now an aggregation of priority nodes.
The thread priority aggregation for the home scheduler instance of a
thread consists of at least one priority node, which is normally the
real priority of the thread. The locking protocols (e.g. priority
ceiling and priority inheritance), rate-monotonic period objects and the
POSIX sporadic server add, change and remove priority nodes.

A thread changes its priority now immediately, e.g. priority changes are
not deferred until the thread releases its last resource.

Replace the _Thread_Change_priority() function with

  • _Thread_Priority_perform_actions(),
  • _Thread_Priority_add(),
  • _Thread_Priority_remove(),
  • _Thread_Priority_change(), and
  • _Thread_Priority_update().

Update #2412.
Update #2556.

Location:
testsuites/smptests
Files:
2 edited

Legend:

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

    r8c83cbc r300f6a48  
    316316  check_generations(ctx, B_5_0, A_2_1);
    317317  assert_prio(ctx, B_5_0, 5);
    318   assert_prio(ctx, A_2_1, 0);
     318  assert_prio(ctx, A_2_1, 2);
    319319  request(ctx, A_2_1, REQ_MTX_RELEASE);
    320320  check_generations(ctx, A_2_1, B_5_1);
    321   assert_prio(ctx, A_2_1, 2);
    322321  assert_prio(ctx, B_5_1, 5);
    323322  request(ctx, B_5_1, REQ_MTX_RELEASE);
  • testsuites/smptests/smpscheduler03/init.c

    r8c83cbc r300f6a48  
    4141static test_context test_instance;
    4242
    43 static bool change_priority_filter(
    44   Thread_Control   *thread,
    45   Priority_Control *new_priority,
    46   void             *arg
     43static void apply_priority(
     44  Thread_Control *thread,
     45  Priority_Control new_priority,
     46  bool prepend_it,
     47  Thread_queue_Context *queue_context
    4748)
    4849{
    49   return _Thread_Get_priority( thread ) != *new_priority;
     50  _Thread_queue_Context_clear_priority_updates(queue_context);
     51  _Thread_Wait_acquire(thread, queue_context);
     52  _Thread_Priority_change(
     53    thread,
     54    &thread->Real_priority,
     55    new_priority,
     56    prepend_it,
     57    queue_context
     58  );
     59  _Thread_Wait_release(thread, queue_context);
    5060}
    5161
    5262static void change_priority(
    53   Thread_Control   *thread,
    54   Priority_Control  new_priority,
    55   bool              prepend_it
     63  Thread_Control *thread,
     64  Priority_Control new_priority,
     65  bool prepend_it
    5666)
    5767{
    58   _Thread_Change_priority(
    59     thread,
    60     new_priority,
    61     NULL,
    62     change_priority_filter,
    63     prepend_it
    64   );
     68  Thread_queue_Context queue_context;
     69
     70  apply_priority(thread, new_priority, prepend_it, &queue_context);
     71  _Thread_Priority_update(&queue_context);
    6572}
    6673
     
    198205  ISR_lock_Context scheduler_lock_context;
    199206  Thread_Control *needs_help;
    200   Scheduler_Node *node;
    201 
    202   thread->current_priority = new_priority;
    203   node = _Scheduler_Thread_get_node(thread);
    204   _Scheduler_Node_set_priority(node, new_priority, prepend_it);
     207  Thread_queue_Context queue_context;
     208
     209  apply_priority(thread, new_priority, prepend_it, &queue_context);
    205210
    206211  _Thread_State_acquire( thread, &state_lock_context );
Note: See TracChangeset for help on using the changeset viewer.