Skip to content

Commit 382360d

Browse files
Liu Shixinakpm00
authored andcommitted
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/[email protected] Signed-off-by: Liu Shixin <[email protected]> Acked-by: Oscar Salvador <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Kefeng Wang <[email protected]> Cc: Muchun Song <[email protected]> Cc: Nanyong Sun <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent c5bb27e commit 382360d

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
@@ -2271,7 +2271,7 @@ static struct folio *alloc_surplus_hugetlb_folio(struct hstate *h,
22712271
* as surplus_pages, otherwise it might confuse
22722272
* persistent_huge_pages() momentarily.
22732273
*/
2274-
__prep_account_new_huge_page(h, nid);
2274+
__prep_account_new_huge_page(h, folio_nid(folio));
22752275

22762276
/*
22772277
* We could have raced with the pool size change.

0 commit comments

Comments
 (0)