linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mike Kravetz <mike.kravetz@oracle.com>
To: Zhenguo Yao <yaozhenguo1@gmail.com>,
	akpm@linux-foundation.org, mlevitsk@redhat.com
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [BUG] hugetlbfs: Fix issue of preallocation of gigantic pages can't work
Date: Mon, 29 Nov 2021 12:58:04 -0800	[thread overview]
Message-ID: <1e55a9e5-16fb-c863-e223-df02ad1a0449@oracle.com> (raw)
In-Reply-To: <20211129133803.15653-1-yaozhenguo1@gmail.com>

On 11/29/21 05:38, Zhenguo Yao wrote:
> Preallocation of gigantic pages can't work bacause of commit:b5389086ad7b
> (hugetlbfs: extend the definition of hugepages parameter to support node
> allocation). When nid is NUMA_NO_NODE(-1), alloc_bootmem_huge_page will
> always return without doing allocation. Fix this by adding more check.
> 
> Signed-off-by: Zhenguo Yao <yaozhenguo1@gmail.com>

Thank you,


Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>

-- 
Mike Kravetz

> ---
>  mm/hugetlb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 60f9b6a9582e..6d1603387914 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -2876,7 +2876,7 @@ int __alloc_bootmem_huge_page(struct hstate *h, int nid)
>  	struct huge_bootmem_page *m = NULL; /* initialize for clang */
>  	int nr_nodes, node;
>  
> -	if (nid >= nr_online_nodes)
> +	if (nid != NUMA_NO_NODE && nid >= nr_online_nodes)
>  		return 0;
>  	/* do node specific alloc */
>  	if (nid != NUMA_NO_NODE) {
> 



  reply	other threads:[~2021-11-29 20:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29 13:38 [BUG] hugetlbfs: Fix issue of preallocation of gigantic pages can't work Zhenguo Yao
2021-11-29 20:58 ` Mike Kravetz [this message]
2021-11-30  1:41 ` Baolin Wang
2021-11-30  2:33 ` Muchun Song
2021-11-30  7:48 ` Maxim Levitsky

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=1e55a9e5-16fb-c863-e223-df02ad1a0449@oracle.com \
    --to=mike.kravetz@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mlevitsk@redhat.com \
    --cc=yaozhenguo1@gmail.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;
as well as URLs for NNTP newsgroup(s).