Messages in this thread Patch in this message | | | Date | Mon, 17 Oct 2011 12:31:45 -0700 (PDT) | From | David Rientjes <> | Subject | Re: [PATCH] drivers, vmw_balloon.c: Determine page allocation flag can_sleep outside loop. |
| |
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?
> @@ -419,7 +420,6 @@ static int vmballoon_reserve_page(struct vmballoon *b, bool can_sleep) > else > STATS_INC(b->stats.sleep_alloc); > > - flags = can_sleep ? VMW_PAGE_ALLOC_CANSLEEP : VMW_PAGE_ALLOC_NOSLEEP; > page = alloc_page(flags); > if (!page) { > if (!can_sleep)
| |