[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260107113130.37231-4-lizhe.67@bytedance.com>
Date: Wed, 7 Jan 2026 19:31:25 +0800
From: "Li Zhe" <lizhe.67@...edance.com>
To: <muchun.song@...ux.dev>, <osalvador@...e.de>, <david@...nel.org>,
<akpm@...ux-foundation.org>, <fvdl@...gle.com>
Cc: <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
<lizhe.67@...edance.com>
Subject: [PATCH v2 3/8] mm/hugetlb: move the huge folio to the end of the list during enqueue
For the huge-folio free list, unzeroed huge folios are now inserted at
the tail; a follow-on patch will place pre-zeroed ones at the head, so
that allocations can obtain a pre-zeroed huge folio with minimal
search. Also, placing newly zeroed pages at the head of the queue so
they're chosen first in the next allocation helps keep the cache hot.
Signed-off-by: Li Zhe <lizhe.67@...edance.com>
---
mm/hugetlb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index a7e582abe9f9..42d327152da9 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1312,7 +1312,7 @@ static void enqueue_hugetlb_folio(struct hstate *h, struct folio *folio)
VM_BUG_ON_FOLIO(folio_ref_count(folio), folio);
VM_WARN_ON_FOLIO(folio_test_hugetlb_zeroing(folio), folio);
- list_move(&folio->lru, &h->hugepage_freelists[nid]);
+ list_move_tail(&folio->lru, &h->hugepage_freelists[nid]);
h->free_huge_pages++;
h->free_huge_pages_node[nid]++;
prep_clear_zeroed(folio);
--
2.20.1
Powered by blists - more mailing lists