Red Hat Bugzilla – Bug 799391
Tasks waiting on a state change of another task may get wrong result
Last modified: 2016-05-22 19:34:33 EDT
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.
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.
The fix here is equivalent to c7004d0
git describe --contains c7004d0
Documenting this in the changelog section of kernel-rt.spec
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.
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()
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.