lkml.org 
[lkml]   [2016]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] mm: fix the incorrect hugepages count
From
Date
On 08/07/2016 07:49 PM, zhongjiang wrote:
> From: zhong jiang <zhongjiang@huawei.com>
>
> when memory hotplug enable, free hugepages will be freed if movable node offline.
> therefore, /proc/sys/vm/nr_hugepages will be incorrect.
>
> The patch fix it by reduce the max_huge_pages when the node offline.
>
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
> mm/hugetlb.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index f904246..3356e3a 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -1448,6 +1448,7 @@ static void dissolve_free_huge_page(struct page *page)
> list_del(&page->lru);
> h->free_huge_pages--;
> h->free_huge_pages_node[nid]--;
> + h->max_huge_pages--;
> update_and_free_page(h, page);
> }
> spin_unlock(&hugetlb_lock);
>

Adding Naoya as he was the original author of this code.

From quick look it appears that the huge page will be migrated (allocated
on another node). If my understanding is correct, then max_huge_pages
should not be adjusted here.

--
Mike Kravetz

\
 
 \ /
  Last update: 2016-08-08 20:01    [W:0.066 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site