linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: msgrcv: use freezable blocking call
@ 2015-04-02  3:50 Maninder Singh
  0 siblings, 0 replies; 3+ messages in thread
From: Maninder Singh @ 2015-04-02  3:50 UTC (permalink / raw)
  To: Andrew Morton, Peter Zijlstra
  Cc: Maninder Singh, linux-kernel, Yogesh Narayan Gaur, AJEET YADAV,
	Tejun Heo

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=windows-1252, Size: 6838 bytes --]

Hi Andrew,
Both patches looks fine to us.

Thank You

> On Wed, Apr 01, 2015 at 05:18:46AM +0000, Maninder Singh wrote:
> > Hi Andrew,
> > Thanks for making new patch, Actually there is some problem with our mail editor.
> > It changes tabs with spaces and corrupts the patch, we are solving the same at our end.
> > Thats why i am sending you signed -off by only for both patches.
> 
> Sort it and resend, no real great hurry with these patches, right?

I tend not to bother too much about occasional messy patches.  These
ones appear to be be the first patches from these contributors and
fixing them up only takes a couple of minutes.  If Maninder's team
expects to send more patches in the future then yes, please fix this
stuff.  But for now, the important thing is to get these kernel
problems sorted out.

> > 1. For msgrcv: use freezable blocking call
> > Signed-off-by: Yogesh Gaur <yn.gaur@samsung.com>
> > Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
> > Signed-off-by: Manjeet Pawar <manjeet.p@samsung.com>
> 
> Did you really pass around that patch through 3 people or did it take
> all three of you to modify those two lines?
> 
> Should some of those SoBs be a reviewed-by perhaps?
> 
> 
> > ----> For Peter's Review comment:- This is what, no why mentioned
> > 
> > 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.
> 
> Please put such things in the Changelog so that we can see you've
> thought about things.

I have made that change.

Maninder, we currently have yourself as the primary author of
"restart_syscall: use freezable blocking call".  Is that correct, or
should that be Yogesh Gaur?
--> It is correct

Below are my latest copies of these two patches.  How do they look?
-- > Looks fine, Thnaks for making patches.

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

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>
---

 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
_





From: Maninder Singh <maninder1.s@samsung.com>
Subject: kernel/time/hrtimer.c: restart_syscall: use freezable blocking call

Avoid waking up every thread sleeping in a restart_syscall 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 [<c03e3150>] (schedule_hrtimeout_range_clock+0xdc/0x110)
[<c03e3074>] (schedule_hrtimeout_range_clock+0x0/0x110) from [<c03e31a0>] (schedule_hrtimeout_range+0x1c/0x20)
 r9:d16c9be0 r8:8b7d9c2c r7:00000000 r6:00000000 r5:d16c8028
[<c03e3184>] (schedule_hrtimeout_range+0x0/0x20) from [<c015778c>] (poll_schedule_timeout+0x48/0x6c)
[<c0157744>] (poll_schedule_timeout+0x0/0x6c) from [<c0158994>] (do_sys_poll+0x2c8/0x378) r5:d16c9f78 r4:00000000
[<c01586cc>] (do_sys_poll+0x0/0x378) from [<c0158a84>] (do_restart_poll+0x40/0x5c)
[<c0158a44>] (do_restart_poll+0x0/0x5c) from [<c005710c>] (sys_restart_syscall+0x2c/0x30) r4:fffffe7a
[<c00570e0>] (sys_restart_syscall+0x0/0x30) from [<c001a180>] (ret_fast_syscall+0x0/0x48)

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: Maninder Singh <maninder1.s@samsung.com>
Signed-off-by: Amit Arora <amit.arora@samsung.com>
Reviewed-by : Ajeet Yadav <ajeet.y@samsung.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/time/hrtimer.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN kernel/time/hrtimer.c~restart_syscall-use-freezable-blocking-call kernel/time/hrtimer.c
--- a/kernel/time/hrtimer.c~restart_syscall-use-freezable-blocking-call
+++ a/kernel/time/hrtimer.c
@@ -1767,7 +1767,7 @@ schedule_hrtimeout_range_clock(ktime_t *
 	 * A NULL parameter means "infinite"
 	 */
 	if (!expires) {
-		schedule();
+		freezable_schedule();
 		return -EINTR;
 	}
 
@@ -1781,7 +1781,7 @@ schedule_hrtimeout_range_clock(ktime_t *
 		t.task = NULL;
 
 	if (likely(t.task))
-		schedule();
+		freezable_schedule();
 
 	hrtimer_cancel(&t.timer);
 	destroy_hrtimer_on_stack(&t.timer);
_
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: msgrcv: use freezable blocking call
  2015-04-01  7:35 ` Peter Zijlstra
@ 2015-04-01 19:08   ` Andrew Morton
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2015-04-01 19:08 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Maninder Singh, linux-kernel, Yogesh Narayan Gaur, AJEET YADAV,
	Tejun Heo

On Wed, 1 Apr 2015 09:35:55 +0200 Peter Zijlstra <peterz@infradead.org> wrote:

> On Wed, Apr 01, 2015 at 05:18:46AM +0000, Maninder Singh wrote:
> > Hi Andrew,
> > Thanks for making new patch, Actually there is some problem with our mail editor.
> > It changes tabs with spaces and corrupts the patch, we are solving the same at our end.
> > Thats why i am sending you signed -off by only for both patches.
> 
> Sort it and resend, no real great hurry with these patches, right?

I tend not to bother too much about occasional messy patches.  These
ones appear to be be the first patches from these contributors and
fixing them up only takes a couple of minutes.  If Maninder's team
expects to send more patches in the future then yes, please fix this
stuff.  But for now, the important thing is to get these kernel
problems sorted out.

> > 1. For msgrcv: use freezable blocking call
> > Signed-off-by: Yogesh Gaur <yn.gaur@samsung.com>
> > Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
> > Signed-off-by: Manjeet Pawar <manjeet.p@samsung.com>
> 
> Did you really pass around that patch through 3 people or did it take
> all three of you to modify those two lines?
> 
> Should some of those SoBs be a reviewed-by perhaps?
> 
> 
> > ----> For Peter's Review comment:- This is what, no why mentioned
> > 
> > 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.
> 
> Please put such things in the Changelog so that we can see you've
> thought about things.

I have made that change.

Maninder, we currently have yourself as the primary author of
"restart_syscall: use freezable blocking call".  Is that correct, or
should that be Yogesh Gaur?


Below are my latest copies of these two patches.  How do they look?


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

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>
---

 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
_





From: Maninder Singh <maninder1.s@samsung.com>
Subject: kernel/time/hrtimer.c: restart_syscall: use freezable blocking call

Avoid waking up every thread sleeping in a restart_syscall 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 [<c03e3150>] (schedule_hrtimeout_range_clock+0xdc/0x110)
[<c03e3074>] (schedule_hrtimeout_range_clock+0x0/0x110) from [<c03e31a0>] (schedule_hrtimeout_range+0x1c/0x20)
 r9:d16c9be0 r8:8b7d9c2c r7:00000000 r6:00000000 r5:d16c8028
[<c03e3184>] (schedule_hrtimeout_range+0x0/0x20) from [<c015778c>] (poll_schedule_timeout+0x48/0x6c)
[<c0157744>] (poll_schedule_timeout+0x0/0x6c) from [<c0158994>] (do_sys_poll+0x2c8/0x378) r5:d16c9f78 r4:00000000
[<c01586cc>] (do_sys_poll+0x0/0x378) from [<c0158a84>] (do_restart_poll+0x40/0x5c)
[<c0158a44>] (do_restart_poll+0x0/0x5c) from [<c005710c>] (sys_restart_syscall+0x2c/0x30) r4:fffffe7a
[<c00570e0>] (sys_restart_syscall+0x0/0x30) from [<c001a180>] (ret_fast_syscall+0x0/0x48)

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: Maninder Singh <maninder1.s@samsung.com>
Signed-off-by: Amit Arora <amit.arora@samsung.com>
Reviewed-by : Ajeet Yadav <ajeet.y@samsung.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/time/hrtimer.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN kernel/time/hrtimer.c~restart_syscall-use-freezable-blocking-call kernel/time/hrtimer.c
--- a/kernel/time/hrtimer.c~restart_syscall-use-freezable-blocking-call
+++ a/kernel/time/hrtimer.c
@@ -1767,7 +1767,7 @@ schedule_hrtimeout_range_clock(ktime_t *
 	 * A NULL parameter means "infinite"
 	 */
 	if (!expires) {
-		schedule();
+		freezable_schedule();
 		return -EINTR;
 	}
 
@@ -1781,7 +1781,7 @@ schedule_hrtimeout_range_clock(ktime_t *
 		t.task = NULL;
 
 	if (likely(t.task))
-		schedule();
+		freezable_schedule();
 
 	hrtimer_cancel(&t.timer);
 	destroy_hrtimer_on_stack(&t.timer);
_


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: msgrcv: use freezable blocking call
       [not found] <E4.28.14702.B8C29155@epcpsbgx3.samsung.com>
@ 2015-03-31 21:30 ` Andrew Morton
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2015-03-31 21:30 UTC (permalink / raw)
  To: maninder1.s; +Cc: linux-kernel, yn.gaur, ajeet.y, Peter Zijlstra, Tejun Heo


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
_


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-02  3:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-02  3:50 msgrcv: use freezable blocking call Maninder Singh
  -- strict thread matches above, loose matches on Subject: below --
2015-04-01  5:18 Maninder Singh
2015-04-01  7:35 ` Peter Zijlstra
2015-04-01 19:08   ` Andrew Morton
     [not found] <E4.28.14702.B8C29155@epcpsbgx3.samsung.com>
2015-03-31 21:30 ` Andrew Morton

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).