[EDT][PATCH 1/1] msgsnd use freezable blocking call

From: Maninder Singh
Date: Wed May 06 2015 - 07:30:11 EST


EP-F6AA0618C49C4AEDA73BFF1B39950BAB

Hi ,

Recently shared a patch for using freezable_schedule instead of schedule in msgrcv,
and after analysing message queuie implemntation we have realized even msgsnd can also block, if queue is full,
So in this scenerio msgsnd sets task state as TASK_INTERRUPTIBLE and can schedule function, similar behaviour as msgrcv.
This change is applicable for msgsnd as well.

we have created patch for remotes/linux-next/akpm, because msgrcv patch is already applied at this branch.
so we didnt include <linux/freezer.h>

Signed-off-by: Vaneet narang <v.narang@xxxxxxxxxxx>
Signed-off-by: Maninder Singh <maninder1.s@xxxxxxxxxxx>
---
ipc/msg.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ipc/msg.c b/ipc/msg.c
index a7261d5..da5658e 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -674,7 +674,7 @@ long do_msgsnd(int msqid, long mtype, void __user *mtext,

ipc_unlock_object(&msq->q_perm);
rcu_read_unlock();
- schedule();
+ freezable_schedule();

rcu_read_lock();
ipc_lock_object(&msq->q_perm);
--
1.7.1

Thanks and Regards,
Maninder Singh