mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: maninder1.s@samsung.com
Cc: linux-kernel@vger.kernel.org,
	"v.narang@samsung.com" <v.narang@samsung.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [EDT][PATCH 1/1] msgsnd use freezable blocking call
Date: Wed, 6 May 2015 15:22:09 -0700	[thread overview]
Message-ID: <20150506152209.4a88555e14dc069c9ced65f6@linux-foundation.org> (raw)
In-Reply-To: <1403347040.147731430911797047.JavaMail.weblogic@epmlwas03a>

On Wed, 06 May 2015 11:29:57 +0000 (GMT) Maninder Singh <maninder1.s@samsung.com> 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  <linux/freezer.h>
> 

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?




From: Maninder Singh <maninder1.s@samsung.com>
Subject: ipc/msg.c: msgsnd: use freezable blocking call

Avoid waking up every thread sleeping in a msgsnd 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 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: Vaneet narang <v.narang@samsung.com>
Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Cc: Yogesh Gaur <yn.gaur@samsung.com>
Cc: Manjeet Pawar <manjeet.p@samsung.com>
Cc: Ajeet Yadav <ajeet.y@samsung.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 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);
_


  reply	other threads:[~2015-05-06 22:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-06 11:29 Maninder Singh
2015-05-06 22:22 ` Andrew Morton [this message]
2015-05-07  7:19 Maninder Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150506152209.4a88555e14dc069c9ced65f6@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maninder1.s@samsung.com \
    --cc=rjw@rjwysocki.net \
    --cc=v.narang@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®