Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753295AbbEGHTO (ORCPT ); Thu, 7 May 2015 03:19:14 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:21365 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751675AbbEGHTL (ORCPT ); Thu, 7 May 2015 03:19:11 -0400 X-AuditID: cbfee68f-f793b6d000005f66-52-554b11ede1e3 Date: Thu, 07 May 2015 07:19:07 +0000 (GMT) From: Maninder Singh Subject: Re: [EDT][PATCH 1/1] msgsnd use freezable blocking call To: Andrew Morton Cc: "linux-kernel@vger.kernel.org" , Vaneet Narang , "Rafael J. Wysocki" , Peter Zijlstra , "yn.gaur@samsung.com" Reply-to: maninder1.s@samsung.com MIME-version: 1.0 X-MTR: 20150507071644060@maninder1.s Msgkey: 20150507071644060@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: 20150507071644060@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: <1210676194.185311430983147190.JavaMail.weblogic@epmlwas06c> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrKIsWRmVeSWpSXmKPExsWyRsSkSvetoHeowZV+IYvLu+awOTB6fN4k F8AYxWWTkpqTWZZapG+XwJUx7ddd9oJtshVzzy9ibGC8INPFyMkhJKAmsWjvYzYQW0LARGLV nEYWCFtM4sK99UBxLqCapYwSHw69hiv61rqCGSIxh1Hi5PXdYAkWARWJOZd2MoPYbAL6Emf3 rgOzhQUcJbo2djOC2CJA8XlLJjOBNDMLfGKU+L77BCvEGYoS6288ASviFRCUODnzCdAZHEDb VCTuHjWHCKtKdLauYII4Qk5iydTLUDavxIz2pyww8Wlf1zBD2NIS52dtYIT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sOK6hMQ20Pi5ZSzLBMYZWchSc1C0j4LSTuy mgWMLKsYRVMLkguKk9IrjPSKE3OLS/PS9ZLzczcxgtPQs0U7GP+dtz7EKMDBqMTDK7DTK1SI NbGsuDL3EKMEB7OSCG8vt3eoEG9KYmVValF+fFFpTmrxIUZTYKRNZJYSTc4Hpsi8knhDYxNz U2NTCwNDc3MzJXHe/+dyQ4QE0hNLUrNTUwtSi2D6mDg4pRoYe+zDRFsvri5LeTlDeuPNntzt TPYrpBkm639e0FmxkXvNij3VvKq9wbEn/xm1PTmxzEtx4/LH66bK7buYemrrap6DB1a8unJr 0+lLyrrt6a/dhJpDig8+t+R5x3740EfDiF0Soi4mIjx9184KTBcNZ9OR+b9ir8/kReIviwRW Hzmi0CWxqp0hWomlOCPRUIu5qDgRAEfFUe5ZAwAA 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 t477JIhM018173 Content-Length: 2844 Lines: 63 EP-F6AA0618C49C4AEDA73BFF1B39950BAB >On Wed, 06 May 2015 11:29:57 +0000 (GMT) Maninder Singh wrote: >> EP-F6AA0618C49C4AEDA73BFF1B39950BAB >> >> Hi , >> >> Recently shared a patch for using freezable_schedule instead of schedule in msgrcv, >> and after analysing message queuie implemntation we have realized even msgsnd can also block, if queue is full, >> So in this scenerio msgsnd sets task state as TASK_INTERRUPTIBLE and can schedule function, similar behaviour as msgrcv. >> This change is applicable for msgsnd as well. >> >> we have created patch for remotes/linux-next/akpm, because msgrcv patch is already applied at this branch. .> so we didnt include >> >This changelog is quite poor. It doesn't explain why the change is >being made, it doesn't explain the user-visible effects which are being >fixed, etc. >So I threw it away and copied text from "ipc/msg.c: use freezable >blocking call": >One thing which isn't clear to me: *why* do we want to "Avoid waking up >every thread sleeping in XXX during suspend and resume"? Suspend and >resume are rare operations. Why do we care if a few threads wake up >then go to sleep again? When any task is stuck in Interruptible or Uninterruptible state then waking up of that task fails. If wakeup fails, then suspend operation fails and all process send to frezeer state at this moment also gets wakeup. Correct implementation is that if suspend fails, then kernel would retry suspend operation again after some specific timeinterval for some fixed retry count. But as changes suggested by Mr Colin Cross on LKML https://lkml.org/lkml/2013/5/1/424, for the system calls for which issue has been faced process flag being appended with PF_FREEZER_SKIP. we are testing some scenerio in which we have to do multi suspend-resume scenario, and we faced the problem thats why suggested the change for msgsnd and msgrcv Signed-off-by: Vaneet narang Signed-off-by: Maninder Singh Cc: Yogesh Gaur Cc: Manjeet Pawar Cc: Ajeet Yadav Cc: Peter Zijlstra Cc: Tejun Heo Signed-off-by: Andrew Morton --- ipc/msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN ipc/msg.c~ipc-msgc-msgsnd-use-freezable-blocking-call ipc/msg.c --- a/ipc/msg.c~ipc-msgc-msgsnd-use-freezable-blocking-call +++ a/ipc/msg.c @@ -673,7 +673,7 @@ long do_msgsnd(int msqid, long mtype, vo ipc_unlock_object(&msq->q_perm); rcu_read_unlock(); - schedule(); + freezable_schedule(); rcu_read_lock(); ipc_lock_object(&msq->q_perm); _ ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?