All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor@vmware.com>
To: Rakib Mullick <rakib.mullick@gmail.com>
Cc: David Rientjes <rientjes@google.com>,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] drivers, vmw_balloon.c: Determine page allocation flag can_sleep outside loop.
Date: Mon, 17 Oct 2011 13:16:11 -0700	[thread overview]
Message-ID: <201110171316.12057.dtor@vmware.com> (raw)
In-Reply-To: <CADZ9YHiurKJPiDjVzhcjGtfOGF2gNPNi5eC1snT0Tw5opBSM8w@mail.gmail.com>

On Monday, October 17, 2011 01:10:38 PM Rakib Mullick wrote:
> On Tue, Oct 18, 2011 at 1:31 AM, David Rientjes <rientjes@google.com> 
wrote:
> > On Tue, 18 Oct 2011, Rakib Mullick wrote:
> >> diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c
> >> index 053d36c..6983d80 100644
> >> --- a/drivers/misc/vmw_balloon.c
> >> +++ b/drivers/misc/vmw_balloon.c
> >> @@ -412,6 +412,7 @@ static int vmballoon_reserve_page(struct
> >> vmballoon *b, bool can_sleep) gfp_t flags;
> >>       unsigned int hv_status;
> >>       bool locked = false;
> >> +     flags = can_sleep ? VMW_PAGE_ALLOC_CANSLEEP :
> >> VMW_PAGE_ALLOC_NOSLEEP;
> >> 
> >>       do {
> >>               if (!can_sleep)
> > 
> > Should be folded in with the declaration of gfp_t flags.
> > 
> > Would you also like to add a might_sleep_if(can_sleep) here?
> 
> I'm not sure. But, I don't think it's needed here. can_sleep tells
> whether alloc_page can sleep or not, which has been determined and
> passed by the callee function.
> 

vmballon_reserve_page() is always called from workqueue context and
thus is always allowed to sleep. I do not see the benefit of adding
might_sleep() here.

Thanks,
Dmitry

> 
> Thanks,
> Rakib

      reply	other threads:[~2011-10-17 20:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-17 18:13 [PATCH] drivers, vmw_balloon.c: Determine page allocation flag can_sleep outside loop Rakib Mullick
2011-10-17 18:36 ` Dmitry Torokhov
2011-10-17 19:31 ` David Rientjes
2011-10-17 20:10   ` Rakib Mullick
2011-10-17 20:16     ` Dmitry Torokhov [this message]

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=201110171316.12057.dtor@vmware.com \
    --to=dtor@vmware.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rakib.mullick@gmail.com \
    --cc=rientjes@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.