]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mm/hugetlb: fix nid mismatch in alloc_surplus_hugetlb_folio()
authorLiu Shixin <liushixin2@huawei.com>
Thu, 3 Apr 2025 06:41:38 +0000 (14:41 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 12 Apr 2025 00:32:36 +0000 (17:32 -0700)
commit382360d289c1e1d89df06f33c4d5b874b38ef267
treef3636601b90e9da3e7126b051b0f05d6f699d3b4
parentc5bb27e2da3a6e1006f3e0aeb36d57c1dd1144aa
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: 2273dea6b1e1 ("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>
mm/hugetlb.c