Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753299AbbDATI7 (ORCPT ); Wed, 1 Apr 2015 15:08:59 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:32992 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753043AbbDATIx (ORCPT ); Wed, 1 Apr 2015 15:08:53 -0400 Date: Wed, 1 Apr 2015 12:08:52 -0700 From: Andrew Morton To: Peter Zijlstra Cc: Maninder Singh , "linux-kernel@vger.kernel.org" , Yogesh Narayan Gaur , AJEET YADAV , Tejun Heo Subject: Re: msgrcv: use freezable blocking call Message-Id: <20150401120852.bbfe50191e3d115c1952f55c@linux-foundation.org> In-Reply-To: <20150401073555.GT27490@worktop.programming.kicks-ass.net> References: <1685075594.210481427865525094.JavaMail.weblogic@epmlwas09b> <20150401073555.GT27490@worktop.programming.kicks-ass.net> 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 Content-Length: 6890 Lines: 177 On Wed, 1 Apr 2015 09:35:55 +0200 Peter Zijlstra 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 > > Signed-off-by: Maninder Singh > > Signed-off-by: Manjeet Pawar > > 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 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: [] (__schedule+0x0/0x5d8) from [] (schedule+0x8c/0x90) [] (schedule+0x0/0x90) from [] (do_msgrcv+0x2e0/0x368) [] (do_msgrcv+0x0/0x368) from [] (SyS_msgrcv+0x2c/0x38) [] (SyS_msgrcv+0x0/0x38) from [] (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 Signed-off-by: Manjeet Pawar Signed-off-by: Maninder Singh Reviewed-by : Ajeet Yadav Cc: Peter Zijlstra Cc: Tejun Heo Signed-off-by: Andrew Morton --- 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 #include #include +#include #include #include @@ -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 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) 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 Signed-off-by: Maninder Singh Signed-off-by: Amit Arora Reviewed-by : Ajeet Yadav Cc: Thomas Gleixner Cc: "Rafael J. Wysocki" Cc: Peter Zijlstra Cc: Tejun Heo 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); _ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/