Bug 799391 - Tasks waiting on a state change of another task may get wrong result
Tasks waiting on a state change of another task may get wrong result
Status: CLOSED ERRATA
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: realtime-kernel (Show other bugs)
2.2
Unspecified Unspecified
unspecified Severity unspecified
: 2.2
: ---
Assigned To: John Kacur
David Sommerseth
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-02 11:19 EST by Steven Rostedt
Modified: 2016-05-22 19:34 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: wait_task_interactive() ignores the rt_spin_locks state Consequence: wait_task_interactive() can return with an incorrect result if the task it is waiting for is blocked on a rt_spin_lock() and is waking up. Fix: wait_task_interactive() must also test the saved_state field saved by rt_spin_locks Result: The correct result is returned from wait_task_interactive()
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-09-19 14:03:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Have wait_task_interactive() check saved state of task (1.53 KB, patch)
2012-03-02 11:23 EST, Steven Rostedt
no flags Details | Diff

  None (edit)
Description Steven Rostedt 2012-03-02 11:19:59 EST
When a task calls the function wait_task_interactive(), it waits on the task to change its tasks state. But it does not take into account that spin_locks() in RT will change the real state of the task, but keep a mirror copy of the state, that it resets to when the task unlocks the spin lock.

The wait_task_interactive() may get the wrong result because it sees the temporary state caused by the RT spin lock and not the real state.
Comment 1 Steven Rostedt 2012-03-02 11:23:40 EST
Created attachment 567100 [details]
Have wait_task_interactive() check saved state of task

In RT, spin locks store the task's state in a shadow copy because the wakeup of the spin lock will change it. On unlock the shadow copy is moved to the original tasks state. But this can confuse wait_task_interactive() because it doesn't see the copy of it. This patch makes wait_task_interactive() aware of the copy as well.
Comment 2 John Kacur 2012-05-23 09:00:43 EDT
The fix here is equivalent to c7004d0
git describe --contains c7004d0
v3.2.14-rt24~8

Documenting this in the changelog section of kernel-rt.spec
Comment 6 John Kacur 2012-06-20 18:08:16 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: wait_task_interactive() ignores the rt_spin_locks state
Consequence: wait_task_interactive() can return with an incorrect result if the task it is waiting for is blocked on a rt_spin_lock() and is waking up.
Fix: wait_task_interactive() must also test the saved_state field saved by rt_spin_locks
Result: The correct result is returned from wait_task_interactive()
Comment 10 errata-xmlrpc 2012-09-19 14:03:36 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-1282.html

Note You need to log in before you can comment on or make changes to this bug.