summaryrefslogtreecommitdiff
path: root/ipc/mqueue.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-07-03 13:30:12 (GMT)
committerScott Wood <scottwood@freescale.com>2014-04-10 00:19:04 (GMT)
commit2451925754ad11895bea6ad37dc13942b04641a8 (patch)
tree838ff440253179991a531cbec58d2882a586c00d /ipc/mqueue.c
parent1ba2a0b1f0b6ec80afc57debe8c46c42df9c78e2 (diff)
downloadlinux-fsl-qoriq-2451925754ad11895bea6ad37dc13942b04641a8.tar.xz
ipc: Make the ipc code -rt aware
RT serializes the code with the (rt)spinlock but keeps preemption enabled. Some parts of the code need to be atomic nevertheless. Protect it with preempt_disable/enable_rt pairts. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'ipc/mqueue.c')
-rw-r--r--ipc/mqueue.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index bb0248f..af0c6bb 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -923,12 +923,17 @@ static inline void pipelined_send(struct mqueue_inode_info *info,
struct msg_msg *message,
struct ext_wait_queue *receiver)
{
+ /*
+ * Keep them in one critical section for PREEMPT_RT:
+ */
+ preempt_disable_rt();
receiver->msg = message;
list_del(&receiver->list);
receiver->state = STATE_PENDING;
wake_up_process(receiver->task);
smp_wmb();
receiver->state = STATE_READY;
+ preempt_enable_rt();
}
/* pipelined_receive() - if there is task waiting in sys_mq_timedsend()