Commit 34d925f9 authored by Lee Schermerhorn's avatar Lee Schermerhorn Committed by James Toy

Fixes bug detected by libhugetlbfs test suite in:

hugetlb-use-free_pool_huge_page-to-return-unused-surplus-pages.patch

Can't just "continue" for node with no surplus pages when returning
unused surplus.  We need to advance to 'next node to free'.

With this fix, the "hugetlb balance free across nodes" series passes
the test suite.
Signed-off-by: default avatarLee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Nishanth Aravamudan <nacc@us.ibm.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Adam Litke <agl@us.ibm.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Eric Whitney <eric.whitney@hp.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent f62d1959
......@@ -698,13 +698,11 @@ static int free_pool_huge_page(struct hstate *h, bool acct_surplus)
do {
/*
* If we're returning unused surplus pages, skip nodes
* with no surplus.
* If we're returning unused surplus pages, only examine
* nodes with surplus pages.
*/
if (acct_surplus && !h->surplus_huge_pages_node[next_nid])
continue;
if (!list_empty(&h->hugepage_freelists[next_nid])) {
if ((!acct_surplus || h->surplus_huge_pages_node[next_nid]) &&
!list_empty(&h->hugepage_freelists[next_nid])) {
struct page *page =
list_entry(h->hugepage_freelists[next_nid].next,
struct page, lru);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment