From nobody Mon Feb 9 19:25:38 2026 Received: from sg-1-102.ptr.blmpb.com (sg-1-102.ptr.blmpb.com [118.26.132.102]) (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 BE01E235BE2 for ; Thu, 25 Dec 2025 08:22:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=118.26.132.102 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766650949; cv=none; b=YroY1EksrLFvb5ikTQ6CofZxj+Ld34vrkZYoiS7dlxlUeDQKiOYUCCzXWtYkEf9oFF168d2Eqa1edltdDe6ORS/60/thttIK6jp2WLvbh8w6v8VGOjudj5SsHZxGYxqNF9A9sqmWT6/c0qAAPQ59sfBRaKeBn0O1wbwnxUdsvG8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766650949; c=relaxed/simple; bh=rA2ogcxcGOGCTmhdh+3lxnXL54WJnBR7ukwiPqWeWuo=; h=To:Date:Content-Type:From:Mime-Version:In-Reply-To:References:Cc: Subject:Message-Id; b=fZXnfVR2cjSH3uvRQ2SM/S5zlG8fqCieze5Kv1LwmmMsmIJ7p8T8tM0YWK8n+uYO+PglQjeTD5shTkD1yi0jGvj554EswOrDsI6L0y5vu8tSJa0M1/t8qLj22zoX7j2ENneGlUQOFXqqNIPLAcjmkwtiZnCJZGCUJFR2X+3pM5M= 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=MWaCbPQu; arc=none smtp.client-ip=118.26.132.102 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="MWaCbPQu" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=2212171451; d=bytedance.com; t=1766650930; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=8UJwqsCU7lKx7MsCtXv7Xp41I0TJ8HI3IDAYvOZfD+4=; b=MWaCbPQu8GTmozuRmHrykATUlgO2YPmKAcBH007EnG3KE7muzSEjdmQmJ/Tbgono/biUbq qIngagg+a9e/CiBczSE0hHY7TQJbOjFIubeabmh6EXb7kCuv9dpFUJcBDvVpF2Il6QbsCK kjJmEtsvZBA9O5wYj/WFAFDH5M2JkJKMSgRuMLhesTxeiTsVny2UHoZCA1rg6nJIK4dJBn VzHQ2ynv9ADTwXXkeHsXLMwhVmNnQUO1RIcMwQl5TTn1D+ugxLgyWxQhvuHoEQp6ButZKY EdxI5RPLHrR187XI6XmJInlXlO7OpfuaIlsJCse/FwYejRNZ84BkasR1/+nh5A== To: , , , , Date: Thu, 25 Dec 2025 16:20:54 +0800 X-Original-From: lizhe.67@bytedance.com X-Lms-Return-Path: From: =?utf-8?q?=E6=9D=8E=E5=96=86?= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 In-Reply-To: <20251225082059.1632-1-lizhe.67@bytedance.com> X-Mailer: git-send-email 2.45.2 References: <20251225082059.1632-1-lizhe.67@bytedance.com> Content-Transfer-Encoding: quoted-printable Cc: , , Subject: [PATCH 3/8] mm/hugetlb: move the huge folio to the end of the list during enqueue Message-Id: <20251225082059.1632-4-lizhe.67@bytedance.com> Content-Type: text/plain; charset="utf-8" From: Li Zhe 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 63f9369789b5..8d36487659f8 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