Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753190AbbDBDuJ (ORCPT ); Wed, 1 Apr 2015 23:50:09 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:39490 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753120AbbDBDuF (ORCPT ); Wed, 1 Apr 2015 23:50:05 -0400 X-AuditID: cbfee691-f79b86d000004a5a-f5-551cbc6a0d22 Date: Thu, 02 Apr 2015 03:50:02 +0000 (GMT) From: Maninder Singh Subject: Re: msgrcv: use freezable blocking call To: Andrew Morton , Peter Zijlstra Cc: Maninder Singh , "linux-kernel@vger.kernel.org" , Yogesh Narayan Gaur , AJEET YADAV , Tejun Heo Reply-to: maninder1.s@samsung.com MIME-version: 1.0 X-MTR: 20150402034332746@maninder1.s Msgkey: 20150402034332746@maninder1.s X-EPLocale: en_US.windows-1252 X-Priority: 3 X-EPWebmail-Msg-Type: personal X-EPWebmail-Reply-Demand: 0 X-EPApproval-Locale: X-EPHeader: ML X-MLAttribute: X-RootMTR: 20150402034332746@maninder1.s X-ParentMTR: X-ArchiveUser: X-CPGSPASS: N X-ConfirmMail: N,general Content-type: text/plain; charset=windows-1252 MIME-version: 1.0 Message-id: <1948613584.275021427946601466.JavaMail.weblogic@epmlwas09c> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrEIsWRmVeSWpSXmKPExsWyRsSkSjdrj0yowcZzmhaXd81hc2D0+LxJ LoAxissmJTUnsyy1SN8ugSvjwZ9G9oJlnhUbvuk0MG5w72Lk5BASUJNYtPcxG4gtIWAi8e3q FHYIW0ziwr31QHEuoJqljBJXnnWywxQdPPWdGSIxh1Hi8tQzQA4HB4uAisT367kgNWwC+hJn 965jBrGFBQwkFv/5C7ZARCBKYuHCC0wgNrPAE0aJqxe9II5QlFh/4wkjiM0rIChxcuYTFohd KhKTr69lAxnPK6AqcaxTEiIsJ7Fk6mUmCJtXYkb7UxaY+LSva5ghbG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3Q3YI20DiyKI5rKheATnfQ6JtJ8sERtlZSDKzkHTPQtKNrGYB I8sqRtHUguSC4qT0CkO94sTc4tK8dL3k/NxNjOAE9GzhDsYv560PMQpwMCrx8GpGSIcKsSaW FVfmHmKU4GBWEuGdUi0TKsSbklhZlVqUH19UmpNafIjRFBhlE5mlRJPzgckxryTe0NjE3NTY 1MLA0NzcTEmc9/+53BAhgfTEktTs1NSC1CKYPiYOTqkGxlNn7n1R8v35+5zwQr61rjm5EUFz XILvcz0KrbN//zdt15EXbVbbS7Q85JNF40P1jAvmGdUGvZq0q8MkUmcmp+zhP3lXXT3Sp+15 sinRJMnl5K5rV87e+7fD9km9mXW67vz5bj/67x6cdN2jn1c25LLG3yv8v979u+ozcW93t9OD 08HfRK8qTlViKc5INNRiLipOBABwAJa3VgMAAA== DLP-Filter: Pass X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id t323oGjm007215 Content-Length: 6838 Lines: 175 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 > > 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? --> 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 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); _ ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?