diff options
author | KOBAYASHI Yoshitake <yoshitake.kobayashi@toshiba.co.jp> | 2011-07-23 02:57:36 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2015-02-13 22:20:28 (GMT) |
commit | 1d649e7690ec8bfa19dc0e4effbea7199abaecea (patch) | |
tree | f543f37c2abc1a3683eab03743ecb64ae5754995 /ipc/Makefile | |
parent | b0c9323c7fbd3447ea90d26a1e2e269138730cfe (diff) | |
download | linux-fsl-qoriq-1d649e7690ec8bfa19dc0e4effbea7199abaecea.tar.xz |
ipc/mqueue: Add a critical section to avoid a deadlock
(Repost for v3.0-rt1 and changed the distination addreses)
I have tested the following patch on v3.0-rt1 with PREEMPT_RT_FULL.
In POSIX message queue, if a sender process uses SCHED_FIFO and
has a higher priority than a receiver process, the sender will
be stuck at ipc/mqueue.c:452
452 while (ewp->state == STATE_PENDING)
453 cpu_relax();
Description of the problem
(receiver process)
1. receiver changes sender's state to STATE_PENDING (mqueue.c:846)
2. wake up sender process and "switch to sender" (mqueue.c:847)
Note: This context switch only happens in PREEMPT_RT_FULL kernel.
(sender process)
3. sender check the own state in above loop (mqueue.c:452-453)
*. receiver will never wake up and cannot change sender's state to
STATE_READY because sender has higher priority
Signed-off-by: Yoshitake Kobayashi <yoshitake.kobayashi@toshiba.co.jp>
Cc: viro@zeniv.linux.org.uk
Cc: dchinner@redhat.com
Cc: npiggin@kernel.dk
Cc: hch@lst.de
Cc: arnd@arndb.de
Link: http://lkml.kernel.org/r/4E2A38A0.1090601@toshiba.co.jp
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'ipc/Makefile')
0 files changed, 0 insertions, 0 deletions