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: Increment alloc and sleep_alloc only when page allocation succeeds.
Date
On Monday, October 17, 2011 12:35:34 PM David Rientjes wrote:
> On Tue, 18 Oct 2011, Rakib Mullick wrote:
> > While doing allocation statistics in vmballoon_reserve_page function,
> >
> > alloc and sleep_alloc has been incremented even if allocation fails.
> > But,
> > b->stats.alloc and b->stats.sleep_alloc supposed to increment only
> > when they succeed. This patch makes sure that, alloc and sleep_alloc
> > gets incremented when page allocation succeeds.
>
> Dmitry could say for sure, but this seems to actually change the
> semantics. If the allocations fail, it increments alloc_fail and
> sleep_alloc_fail accordingly so you could easily see 10 alloc and 5
> alloc_fail. With your patch, it would be 5 alloc and 5 alloc_fail.
>
> I don't know which one is best, but I would opt to stay with the
> semantics that alloc and sleep_alloc have already had rather than
> changing them.

Right, b->stats.alloc and b->stats.sleep_alloc show number of allocation
attempts and alloc_fail and sleep_alloc_fail show how many of these
attempts failed. This behavior matches behavior of the driver we have
been shipping out of the tree for many years and I would prefer to keep
it as is.

Thanks,
Dmitry



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