On Mon, 2007-09-17 at 21:42 +0300, Mika Penttilä wrote:
> Adam Litke wrote:
> > On Mon, 2007-09-17 at 20:22 +0300, Mika Penttilä wrote:
> >   
> >>> +void return_unused_surplus_pages(void)
> >>> +{
> >>> + static int nid = -1;
> >>> + int delta;
> >>> + struct page *page;
> >>> +
> >>> + delta = unused_surplus_pages - resv_huge_pages;
> >>> +
> >>> + while (delta) {
> >>>   
> >>>       
> >> Shouldn't this be while (delta >= 0) ?
> >>     
> >
> > unused_surplus_pages is always >= resv_huge_pages so delta cannot go
> > negative.  But for clarity it makes sense to apply the change you
> > suggest.  Thanks for responding.
> >
> >   
> I think unused_surplus_pages accounting isn't quite right. It gets 
> always decremented in dequeue_huge_page() but incremented only if we 
> haven't enough free pages at reserve time.

Ahh yes, good catch.  The solution is to only decrement
unused_surplus_pages in dequeue_huge_page() until it becomes zero.  Once
that condition is true we know that return_unused_surplus_pages() will
have no work to do.  Thank you for your careful review.  I am now
testing this case specifically.

-- 
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Libhugetlbfs-devel mailing list
Libhugetlbfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to