Skip to content

Commit 4fae9bd

Browse files
Yogesh Gaurhnaz
authored andcommitted
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 <[email protected]> Signed-off-by: Manjeet Pawar <[email protected]> Signed-off-by: Maninder Singh <[email protected]> Reviewed-by : Ajeet Yadav <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Tejun Heo <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 3994275 commit 4fae9bd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ipc/msg.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include <linux/rwsem.h>
3838
#include <linux/nsproxy.h>
3939
#include <linux/ipc_namespace.h>
40+
#include <linux/freezer.h>
4041

4142
#include <asm/current.h>
4243
#include <linux/uaccess.h>
@@ -917,7 +918,7 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
917918

918919
ipc_unlock_object(&msq->q_perm);
919920
rcu_read_unlock();
920-
schedule();
921+
freezable_schedule();
921922

922923
/* Lockless receive, part 1:
923924
* Disable preemption. We don't hold a reference to the queue

0 commit comments

Comments
 (0)