diff options
author | Yogesh Gaur <yn.gaur@samsung.com> | 2015-08-25 14:21:41 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2015-08-25 14:21:41 +1000 |
commit | 25eef33f38d43ddea414001109c73004ff148898 (patch) | |
tree | e58f2bc868fd563b027b0e956edb1b33cd6d3e9e /ipc | |
parent | 6119d431c1906b3c716b1ef5134f991a09cac1b8 (diff) |
ipc/msg.c: use freezable blocking call
Avoid waking up every thread sleeping in a msgrcv 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.
Ref: https://lkml.org/lkml/2013/5/1/424
Backtrace:
[<c03e3924>] (__schedule+0x0/0x5d8) from [<c03e3f88>] (schedule+0x8c/0x90)
[<c03e3efc>] (schedule+0x0/0x90) from [<c01ef9f8>] (do_msgrcv+0x2e0/0x368)
[<c01ef718>] (do_msgrcv+0x0/0x368) from [<c01efaac>] (SyS_msgrcv+0x2c/0x38)
[<c01efa80>] (SyS_msgrcv+0x0/0x38) from [<c001a180>] (ret_fast_syscall+0x0/0x48)
tPlay0Cb2 R running 0 297 204 0x00000001
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: Yogesh Gaur <yn.gaur@samsung.com>
Signed-off-by: Manjeet Pawar <manjeet.p@samsung.com>
Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Reviewed-by : 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.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ipc/msg.c b/ipc/msg.c index 8d37f729e3e0..f675689290ca 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -37,6 +37,7 @@ #include <linux/rwsem.h> #include <linux/nsproxy.h> #include <linux/ipc_namespace.h> +#include <linux/freezer.h> #include <asm/current.h> #include <linux/uaccess.h> @@ -917,7 +918,7 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl ipc_unlock_object(&msq->q_perm); rcu_read_unlock(); - schedule(); + freezable_schedule(); /* Lockless receive, part 1: * Disable preemption. We don't hold a reference to the queue |