From: Andrew Morton <akpm@linux-foundation.org>
To: Liu Shixin <liushixin2@huawei.com>
Cc: Muchun Song <muchun.song@linux.dev>,
David Hildenbrand <david@redhat.com>,
Oscar Salvador <osalvador@suse.de>,
Kefeng Wang <wangkefeng.wang@huawei.com>,
Peter Xu <peterx@redhat.com>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] mm/hugetlb: update nr_huge_pages and surplus_huge_pages together
Date: Wed, 2 Apr 2025 20:53:03 -0700 [thread overview]
Message-ID: <20250402205303.17846a389ee2ec2a9ee7ae13@linux-foundation.org> (raw)
In-Reply-To: <8f63f6bd-41ab-c819-291c-f66c239da27b@huawei.com>
On Tue, 1 Apr 2025 16:12:29 +0800 Liu Shixin <liushixin2@huawei.com> wrote:
> > + /*
> > + * nr_huge_pages needs to be adjusted within the same lock cycle
> > + * as surplus_pages, otherwise it might confuse
> > + * persistent_huge_pages() momentarily.
> > + */
> > + __prep_account_new_huge_page(h, nid);
> > +
> > /*
> > * We could have raced with the pool size change.
> > * Double check that and simply deallocate the new page
>
> Hi,
>
> Sorry, there's a mistake that the nid may be mismatch.
> Please use the following code to fix it, or should I send a fix patch ?
>
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 39f92aad7bd1..6670f9b9e07a 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -2271,7 +2271,7 @@ static struct folio *alloc_surplus_hugetlb_folio(struct hstate *h,
> * as surplus_pages, otherwise it might confuse
> * persistent_huge_pages() momentarily.
> */
> - __prep_account_new_huge_page(h, nid);
> + __prep_account_new_huge_page(h, folio_nid(folio));
>
> /*
> * We could have raced with the pool size change.
Yes, please send a formal patch, with
Fixes: 2273dea6b1e1 ("mm/hugetlb: update nr_huge_pages and surplus_huge_pages together")
prev parent reply other threads:[~2025-04-03 3:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-05 3:54 Liu Shixin
2025-03-05 12:12 ` Peter Xu
2025-03-06 9:15 ` Oscar Salvador
2025-04-01 8:12 ` Liu Shixin
2025-04-03 3:53 ` Andrew Morton [this message]
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=20250402205303.17846a389ee2ec2a9ee7ae13@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liushixin2@huawei.com \
--cc=muchun.song@linux.dev \
--cc=osalvador@suse.de \
--cc=peterx@redhat.com \
--cc=wangkefeng.wang@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