[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250402205303.17846a389ee2ec2a9ee7ae13@linux-foundation.org>
Date: Wed, 2 Apr 2025 20:53:03 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Liu Shixin <liushixin2@...wei.com>
Cc: Muchun Song <muchun.song@...ux.dev>, David Hildenbrand
<david@...hat.com>, Oscar Salvador <osalvador@...e.de>, Kefeng Wang
<wangkefeng.wang@...wei.com>, Peter Xu <peterx@...hat.com>,
<linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] mm/hugetlb: update nr_huge_pages and
surplus_huge_pages together
On Tue, 1 Apr 2025 16:12:29 +0800 Liu Shixin <liushixin2@...wei.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")
Powered by blists - more mailing lists