public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* restart_syscall: use freezable blocking call
@ 2015-03-30 11:07 Maninder Singh
  2015-03-30 22:43 ` Andrew Morton
  0 siblings, 1 reply; 7+ messages in thread
From: Maninder Singh @ 2015-03-30 11:07 UTC (permalink / raw)
  To: tglx, akpm@linux-foundation.org, linux-kernel@vger.kernel.org
  Cc: Yogesh Narayan Gaur, AJEET YADAV

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

Hello All, 

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
We have faced similiar issue of sleep fail when calling restart() system call in stress testing.

Patch :-
Subject: 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)
esTask03        R running      0   270    204 0x00000001
Signed-off-by: Yogesh Gaur <yn.gaur <at> samsung.com>
Signed-off-by: Amit Arora <amit.arora <at> samsung.com>
Reviewed-by : Ajeet Yadav <ajeet.y <at> samsung.com>
---
 kernel/time/hrtimer.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 37e50aa..75ebc3f 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1775,7 +1775,7 @@ schedule_hrtimeout_range_clock(ktime_t *expires, unsigned long delta,
   * A NULL parameter means "infinite"
   */
  if (!expires) {
-  schedule();
+  freezable_schedule();
   return -EINTR;
  }
 
@@ -1789,7 +1789,7 @@ schedule_hrtimeout_range_clock(ktime_t *expires, unsigned long delta,
   t.task = NULL;
 
  if (likely(t.task))
-  schedule();
+  freezable_schedule();
 
  hrtimer_cancel(&t.timer);
  destroy_hrtimer_on_stack(&t.timer);
-- 
1.7.1




Thanks and Regards,
Maninder Singhÿôèº{.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 related	[flat|nested] 7+ messages in thread

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

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-30 11:07 restart_syscall: use freezable blocking call Maninder Singh
2015-03-30 22:43 ` Andrew Morton
2015-03-30 23:39   ` Rafael J. Wysocki
2015-03-31 15:07     ` Peter Zijlstra
2015-04-02 16:03       ` Sasha Levin
2015-04-02 17:25         ` Peter Zijlstra
2015-04-02 17:34           ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox