aboutsummaryrefslogtreecommitdiff
path: root/ipc
diff options
context:
space:
mode:
authorManinder Singh <maninder1.s@samsung.com>2015-08-25 14:21:41 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2015-08-25 14:21:41 +1000
commit6119d431c1906b3c716b1ef5134f991a09cac1b8 (patch)
treeb4ff4a678af686ce23bdd63acbcc792b0c46478d /ipc
parent643ce1f5fc2d4626ea445c578a335e507cc47e83 (diff)
ipc/msg.c: msgsnd: use freezable blocking call
When any task is stuck in Interruptible or Uninterruptible state then waking up of that task fails. If wakeup fails, then suspend operation fails and all process send to frezeer state at this moment also gets wakeup. Correct implementation is that if suspend fails, then kernel would retry suspend operation again after some specific timeinterval for some fixed retry count. But as changes suggested by Mr Colin Cross (https://lkml.org/lkml/2013/5/1/424), for the system calls for which issue has been faced process flag being appended with PF_FREEZER_SKIP. We are testing some scenarios in which we have to do multi suspend-resume scenario, and we faced the problem, hence the suggested changes for msgsnd and msgrcv. Avoid waking up every thread sleeping in a msgsnd call during suspend and resume by calling a freezable blocking call. Previous patches modified the freezer to avoid sending wakeups to threads that are blocked in freezable blocking calls. This call was selected to be converted to a freezable call because it doesn't hold any locks or release any resources when interrupted that might be needed by another freezing task or a kernel driver during suspend, and is a common site where idle userspace tasks are blocked. Signed-off-by: Vaneet narang <v.narang@samsung.com> Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Cc: Yogesh Gaur <yn.gaur@samsung.com> Cc: Manjeet Pawar <manjeet.p@samsung.com> Cc: Ajeet Yadav <ajeet.y@samsung.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'ipc')
-rw-r--r--ipc/msg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ipc/msg.c b/ipc/msg.c
index 66c4f567eb73..8d37f729e3e0 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -675,7 +675,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);