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 11:13:47 AM Rakib Mullick wrote:
> In vmballoon_reserve_page function, flags has been passed from the
> callee function (vmballoon_inflate here). So, we can determine
> can_sleep outside the loop.
>
> Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>

Thanks Rakib.

Acked-by: Dmitry Torokhov <dtor@vmware.com>

> ---
>
> 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)
> @@ -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)


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