LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: maninder1.s@samsung.com
Cc: linux-kernel@vger.kernel.org,
	"yn.gaur@samsung.com" <yn.gaur@samsung.com>,
	"ajeet.y@samsung.com" <ajeet.y@samsung.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Tejun Heo <tj@kernel.org>
Subject: Re: msgrcv: use freezable blocking call
Date: Tue, 31 Mar 2015 14:30:33 -0700	[thread overview]
Message-ID: <20150331143033.d30ae11b712526eba3883cc4@linux-foundation.org> (raw)
In-Reply-To: <E4.28.14702.B8C29155@epcpsbgx3.samsung.com>


Presumably Peter's review comments for "restart_syscall: use freezable
blocking call" also apply here.

Please send your signed-off-by: for both patches, as detailed in
Documentation/SubmittingPatches section 11, thanks.


From: Yogesh Gaur <yn.gaur@samsung.com>
Subject: 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

Signed-off-by: Yogesh Gaur <yn.gaur@samsung.com>
Signed-off-by: Manjeet Pawar <manjeet.p@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>
---

 ipc/msg.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -puN ipc/msg.c~msgrcv-use-freezable-blocking-call ipc/msg.c
--- a/ipc/msg.c~msgrcv-use-freezable-blocking-call
+++ a/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>
@@ -915,7 +916,7 @@ long do_msgrcv(int msqid, void __user *b
 
 		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
_


       reply	other threads:[~2015-03-31 21:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E4.28.14702.B8C29155@epcpsbgx3.samsung.com>
2015-03-31 21:30 ` Andrew Morton [this message]
2015-04-01  5:18 Maninder Singh
2015-04-01  7:35 ` Peter Zijlstra
2015-04-01 19:08   ` Andrew Morton
2015-04-02  3:50 Maninder Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150331143033.d30ae11b712526eba3883cc4@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=ajeet.y@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maninder1.s@samsung.com \
    --cc=tj@kernel.org \
    --cc=yn.gaur@samsung.com \
    --subject='Re: msgrcv: use freezable blocking call' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).