From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753662AbbC3XO5 (ORCPT ); Mon, 30 Mar 2015 19:14:57 -0400 Received: from v094114.home.net.pl ([79.96.170.134]:62463 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751933AbbC3XO4 (ORCPT ); Mon, 30 Mar 2015 19:14:56 -0400 From: "Rafael J. Wysocki" To: "linux-kernel@vger.kernel.org" Cc: Andrew Morton , maninder1.s@samsung.com, tglx@linutronix.de, Yogesh Narayan Gaur , AJEET YADAV , Peter Zijlstra , Tejun Heo Subject: Re: restart_syscall: use freezable blocking call Date: Tue, 31 Mar 2015 01:39:07 +0200 Message-ID: <1982905.Ac4fTCSUaY@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/3.19.0+; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20150330154351.2582ba70df824c6ccc55fb28@linux-foundation.org> References: <380509604.92081427713655432.JavaMail.weblogic@epmlwas01c> <20150330154351.2582ba70df824c6ccc55fb28@linux-foundation.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CC more maintainers. On Monday, March 30, 2015 03:43:51 PM Andrew Morton wrote: > On Mon, 30 Mar 2015 11:07:35 +0000 (GMT) Maninder Singh wrote: > > > 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. > > This patch is rather mucked up - tabs replaced with spaces, apparently > mangled text in the changelog. > > Thomas is having a bit of time off, so I fixed most of that up and > queued the patch in -mm for some testing. Hopefully Thomas and/or > Rafael will be able to comment? > > > From: Maninder Singh > 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: > [] (__schedule+0x0/0x5d8) from [] (schedule+0x8c/0x90) > [] (schedule+0x0/0x90) from [] (schedule_hrtimeout_range_clock+0xdc/0x110) > [] (schedule_hrtimeout_range_clock+0x0/0x110) from [] (schedule_hrtimeout_range+0x1c/0x20) > r9:d16c9be0 r8:8b7d9c2c r7:00000000 r6:00000000 r5:d16c8028 > [] (schedule_hrtimeout_range+0x0/0x20) from [] (poll_schedule_timeout+0x48/0x6c) > [] (poll_schedule_timeout+0x0/0x6c) from [] (do_sys_poll+0x2c8/0x378) r5:d16c9f78 r4:00000000 > [] (do_sys_poll+0x0/0x378) from [] (do_restart_poll+0x40/0x5c) > [] (do_restart_poll+0x0/0x5c) from [] (sys_restart_syscall+0x2c/0x30) r4:fffffe7a > [] (sys_restart_syscall+0x0/0x30) from [] (ret_fast_syscall+0x0/0x48) > > > Signed-off-by: Yogesh Gaur samsung.com> > Signed-off-by: Amit Arora samsung.com> > Reviewed-by : Ajeet Yadav samsung.com> > Cc: Thomas Gleixner > Cc: "Rafael J. Wysocki" > Signed-off-by: Andrew Morton > --- > > 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); > _ > -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.