From nobody Tue Feb 10 07:39:10 2026 Received: from sg-1-104.ptr.blmpb.com (sg-1-104.ptr.blmpb.com [118.26.132.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 780191D5160 for ; Wed, 7 Jan 2026 11:33:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=118.26.132.104 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767785607; cv=none; b=kiWppmSGiSFLhab2COK7YDYe9ylfV01cGc+4QfhpA1iQQwBpXDPacFGQdDO9qB6zMa2A69xMUPKtX6kTP3Zt/oR1eLRekljLQH/+dasw4UZ8aJwTBH6CV03m7eYEVyq80PeNcY7jAnIO8pokZRZiSJgCGIGJm77ITs3IFzx1IJI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767785607; c=relaxed/simple; bh=5BTIRFt+v2sD6CKQzyBbRcpIhStMGt2S6XD+WlkNoks=; h=To:Message-Id:References:Subject:Mime-Version:Cc:Date:In-Reply-To: Content-Type:From; b=hnegSt2w6PaNU5ZSS4bdwJTOH+hyZiUMnZWmD61X+dfp7T1ygNDMxVy1SIEHRjtbrw7uEOsMd7gAwdgdmYl0Nu7OOsAfiSXzoAjwhGRcGarM3ANELz12Dfs+VNfKjuLTrpzgSH+p7mTJTFrxYxhxkJer60D9+Z9mVhCkcaL2E6Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=nQMFR+/u; arc=none smtp.client-ip=118.26.132.104 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="nQMFR+/u" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=2212171451; d=bytedance.com; t=1767785599; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=9nSEirhy+0vN+k5rbIUt6cf9EJAt01I3/f0PFptLibw=; b=nQMFR+/upHHs3GBwUfVERg4tUQHXza9RNnduhAYjzlqRAKHSCZnprZdVKQyMuKC8yFEEC2 hMY0vlh4koLqsh4nR//suZ9RlNWUqBJutdIkspBkSmdfRswn8nADgyWnjQ0GmBYsXRzFrc wSEsgjKkGFBfVHPgVTr02Kja8sK3RPpDn7mtc7aeM4AKxwotWKxHGIBrg+XgvrqswaivMn GzGw6tbl3XGABwytu2bamFrpJMGHzBPlqUO2A7fHBU+12uPcqdPatFIOkwBxQfZyf6ST80 /HYItB1N3K63x51lcx9S+yaKuRswk3NN7INxWKEgiv6l5LY13l/ey7Vu3jntSg== To: , , , , Message-Id: <20260107113130.37231-4-lizhe.67@bytedance.com> References: <20260107113130.37231-1-lizhe.67@bytedance.com> Content-Transfer-Encoding: quoted-printable Subject: [PATCH v2 3/8] mm/hugetlb: move the huge folio to the end of the list during enqueue Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.45.2 X-Original-From: Li Zhe X-Lms-Return-Path: Cc: , , Date: Wed, 7 Jan 2026 19:31:25 +0800 In-Reply-To: <20260107113130.37231-1-lizhe.67@bytedance.com> From: "Li Zhe" Content-Type: text/plain; charset="utf-8" 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 --- 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, s= truct folio *folio) VM_BUG_ON_FOLIO(folio_ref_count(folio), folio); VM_WARN_ON_FOLIO(folio_test_hugetlb_zeroing(folio), folio); =20 - 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); --=20 2.20.1