From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753465AbbC3Wnx (ORCPT ); Mon, 30 Mar 2015 18:43:53 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57622 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752890AbbC3Wnw (ORCPT ); Mon, 30 Mar 2015 18:43:52 -0400 Date: Mon, 30 Mar 2015 15:43:51 -0700 From: Andrew Morton To: maninder1.s@samsung.com Cc: tglx@linutronix.de, "linux-kernel@vger.kernel.org" , Yogesh Narayan Gaur , AJEET YADAV , "Rafael J. Wysocki" Subject: Re: restart_syscall: use freezable blocking call Message-Id: <20150330154351.2582ba70df824c6ccc55fb28@linux-foundation.org> In-Reply-To: <380509604.92081427713655432.JavaMail.weblogic@epmlwas01c> References: <380509604.92081427713655432.JavaMail.weblogic@epmlwas01c> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); _