lkml.org 
[lkml]   [2011]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] drivers, vmw_balloon.c: Determine page allocation flag can_sleep outside loop.
Date
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


\
 
 \ /
  Last update: 2011-10-17 22:19    [W:0.053 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site