Skip to content

Commit b889775

Browse files
committed
mm/hugetlb: fix nid mismatch in alloc_surplus_hugetlb_folio()
commit 382360d Author: Liu Shixin <liushixin2@huawei.com> Date: Thu Apr 3 14:41:38 2025 +0800 mm/hugetlb: fix nid mismatch in alloc_surplus_hugetlb_folio() It's wrong to use nid directly since the nid may be changed in allocation. Use folio_nid() to obtain the nid of folio instead. Fix: 2273dea ("mm/hugetlb: update nr_huge_pages and surplus_huge_pages together") Link: https://lkml.kernel.org/r/20250403064138.2867929-1-liushixin2@huawei.com Signed-off-by: Liu Shixin <liushixin2@huawei.com> Acked-by: Oscar Salvador <osalvador@suse.de> Cc: David Hildenbrand <david@redhat.com> Cc: Kefeng Wang <wangkefeng.wang@huawei.com> Cc: Muchun Song <muchun.song@linux.dev> Cc: Nanyong Sun <sunnanyong@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> JIRA: https://issues.redhat.com/browse/RHEL-77742 Signed-off-by: Nico Pache <npache@redhat.com>
1 parent 7a6fe29 commit b889775

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/hugetlb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2327,7 +2327,7 @@ static struct folio *alloc_surplus_hugetlb_folio(struct hstate *h,
23272327
* as surplus_pages, otherwise it might confuse
23282328
* persistent_huge_pages() momentarily.
23292329
*/
2330-
__prep_account_new_huge_page(h, nid);
2330+
__prep_account_new_huge_page(h, folio_nid(folio));
23312331

23322332
/*
23332333
* We could have raced with the pool size change.

0 commit comments

Comments
 (0)