#1124 closed defect (fixed)

priority ceiling inheritance in wrong location

Reported by: Joel Sherrill Owned by: Joel Sherrill
Priority: highest Milestone: 2
Component: score Version: 4.7
Severity: critical Keywords:
Cc: bugs@… Blocked By:
Blocking:

Description

The code in question was discussed in the following thread but was
determined that it was not a critical issue. This decision was because
threads were not reordered on priority thread queues on priority changes.
Whether a thread's priority was elevated when it blocked or when it
received the mutex doesn't matter since it blocked using its original
priority.

http://www.rtems.com/ml/rtems-users/2006/may/msg00052.html

However, with the idea of reordering of priority queues on
thread priority under consideration, this is a serious issue.
Consider this:

+ T1 (priority=low) blocks on priority ceiling mutex
+ T1 inherits ceiling priority (priority=high) and the

thread queue is reordered to reflect this.

Now every thread that blocks will have its priority changed to
the ceiling and the blocking list will effectively be FIFO.

Worse, the priority change is made inside a check to see if the
mutex was successfully acquired. This assumes the thread actually
blocked between the call to _Thread_queue_Enqueue and the check.
Since this is in a dispatching disabled critical section, the thread
continues to run and its priority is ALWAYS changed to the ceiling.
It is conceivable (although not demonstrated) that the thread could
timeout waiting and already have inherited the priority.

Release:
4.5 4.6 4.7 CVS

Environment:
All

Attachments (1)

pri1124-47.diff (3.9 KB) - added by Joel Sherrill on 12/03/06 at 13:31:13.
pri1124-47.diff

Download all attachments as: .zip

Change History (3)

comment:1 Changed on 07/11/06 at 20:11:14 by Joel Sherrill

Status: assignedclosed

State-Changed-From-To: open->closed
State-Changed-Why: Patched on 4.6 and CVS head.

There are patches attached for 4.5, 4.6, and 4.7.

Changed on 12/03/06 at 13:31:13 by Joel Sherrill

Attachment: pri1124-47.diff added

pri1124-47.diff

comment:2 Changed on 02/09/09 at 15:28:02 by Joel Sherrill

attachments.ispatch: 01
attachments.mimetype: text/x-patchtext/plain
Note: See TracTickets for help on using tickets.