From: Mike Kravetz <mike.kravetz@oracle.com>
To: zhongjiang <zhongjiang@huawei.com>,
Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: fix the incorrect hugepages count
Date: Mon, 8 Aug 2016 10:14:48 -0700 [thread overview]
Message-ID: <d00a2c1d-5f02-056c-4eef-dd7514293418@oracle.com> (raw)
In-Reply-To: <1470624546-902-1-git-send-email-zhongjiang@huawei.com>
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
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2016-08-08 17:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-08 2:49 zhongjiang
2016-08-08 17:14 ` Mike Kravetz [this message]
2016-08-09 10:32 ` zhong jiang
2016-08-10 0:07 ` Naoya Horiguchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d00a2c1d-5f02-056c-4eef-dd7514293418@oracle.com \
--to=mike.kravetz@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=zhongjiang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox