All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-hugetlb-fix-nid-mismatch-in-alloc_surplus_hugetlb_folio.patch added to mm-hotfixes-unstable branch
@ 2025-04-03  7:05 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-04-03  7:05 UTC (permalink / raw)
  To: mm-commits, wangkefeng.wang, sunnanyong, muchun.song, david,
	liushixin2, akpm


The patch titled
     Subject: mm/hugetlb: fix nid mismatch in alloc_surplus_hugetlb_folio()
has been added to the -mm mm-hotfixes-unstable branch.  Its filename is
     mm-hugetlb-fix-nid-mismatch-in-alloc_surplus_hugetlb_folio.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-hugetlb-fix-nid-mismatch-in-alloc_surplus_hugetlb_folio.patch

This patch will later appear in the mm-hotfixes-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Liu Shixin <liushixin2@huawei.com>
Subject: mm/hugetlb: fix nid mismatch in alloc_surplus_hugetlb_folio()
Date: Thu, 3 Apr 2025 14:41:38 +0800

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>
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 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/hugetlb.c~mm-hugetlb-fix-nid-mismatch-in-alloc_surplus_hugetlb_folio
+++ a/mm/hugetlb.c
@@ -2271,7 +2271,7 @@ static struct folio *alloc_surplus_huget
 	 * 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.
_

Patches currently in -mm which might be from liushixin2@huawei.com are

mm-hugetlb-fix-nid-mismatch-in-alloc_surplus_hugetlb_folio.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-04-03  7:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-03  7:05 + mm-hugetlb-fix-nid-mismatch-in-alloc_surplus_hugetlb_folio.patch added to mm-hotfixes-unstable branch Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.