From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sg-1-101.ptr.blmpb.com (sg-1-101.ptr.blmpb.com [118.26.132.101]) (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 4F170290F for ; Mon, 29 Dec 2025 12:34:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=118.26.132.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767011675; cv=none; b=gE571TsKM7M+fcqo4KF5EN/2IrznwdBUkDDblL6yf3Vn+9hm06dvVqrnFrkbdQU4XFCjCuGCwUG4XIczC5DAwmt2id7DmiC/x+RpsmSh/l7PxXtjTLUW1Yfao9AoV6z91rt5TJk8VbT3tJuyRCc3kbn6Z0Ewrk7hlqZxVTofcDM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767011675; c=relaxed/simple; bh=MTLKtsvpIqGFmNJtpid/ZN3kVcw4XE82rjRgOPLiAM0=; h=In-Reply-To:From:Subject:Mime-Version:References:Content-Type:Cc: To:Date:Message-Id; b=c3lZEZq0hfWH27pFhKoalNa/0feeYs9kC6ydUW86trCdWV6d1nEFKolV77pZ2Gxt7/AGxx3ztpodSFxq54w8W0dwrvaUuT+aloffQbOSHREtJnIjnjs5CuG0fCrKDSZWOAhdmvDeTjvlCb2LTPbMciv14rD9zHG86ahRybkfECo= 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=oaGtEelx; arc=none smtp.client-ip=118.26.132.101 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="oaGtEelx" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=2212171451; d=bytedance.com; t=1767011667; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=UGCjPv294ftgpzkPBae93iouuOvwdl6RovdFpV1TG8w=; b=oaGtEelxI+g/ne++wCICpTQk5vcRIrpb7osSO3pjZWMZC5hAxxqU82kNqDQ/S/QIpCAUdk K+ka+kZSj57thx1JwMEFe6wmbu2228/Eh8119OXje8UKM2mMDDfWouCyACX4pQLtOpzGR9 hoouWasGz5Qu0RnVNZXee4KDBgOm6ifHlsaCxOtDfo+Pn1och6RIV6RgrnY9hcCorgqz9V sM2EQHtq8RvDVSIiSR6EG+P5LDyrTpbFTyRw7nGAUWR26IFNC+fRygFEM4rtw2hh5b1U1K +d/aCWEeIy28bU8ukE8SD+SrK6kY4heULxFFoztJ53dk9kJtIOWEyE1EgjJgqQ== X-Original-From: Li Zhe In-Reply-To: <20251228134454.89617c004a6625556f7ca9f3@linux-foundation.org> X-Lms-Return-Path: From: "Li Zhe" Subject: Re: [PATCH 0/8] Introduce a huge-page pre-zeroing mechanism Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251228134454.89617c004a6625556f7ca9f3@linux-foundation.org> Content-Type: text/plain; charset=UTF-8 Cc: , , , , , , , X-Mailer: git-send-email 2.45.2 To: Date: Mon, 29 Dec 2025 20:34:07 +0800 Message-Id: <20251229123407.7669-1-lizhe.67@bytedance.com> Content-Transfer-Encoding: 7bit On Sun, 28 Dec 2025 13:44:54 -0800, akpm@linux-foundation.org wrote: > > Fresh hugetlb pages are zeroed out when they are faulted in, > > just like with all other page types. This can take up a good > > amount of time for larger page sizes (e.g. around 40 > > milliseconds for a 1G page on a recent AMD-based system). > > > > This normally isn't a problem, since hugetlb pages are typically > > mapped by the application for a long time, and the initial > > delay when touching them isn't much of an issue. > > > > However, there are some use cases where a large number of hugetlb > > pages are touched when an application (such as a VM backed by these > > pages) starts. For 256 1G pages and 40ms per page, this would take > > 10 seconds, a noticeable delay. > > Ankur's contiguous page clearing work > (https://lkml.kernel.org/r/20251215204922.475324-1-ankur.a.arora@oracle.com) > will hopefully result in significant changes to the timing observations > in your changelogs? I conducted the experiment on my Skylake machine; below are the 64-GiB huge-page fault latencies measured with 1-GiB page size. Without Ankur's optimization: Total time: 15.989429 seconds Avg time per 1GB page: 0.249835 seconds With Ankur's optimization: Total time: 12.931696 seconds Avg time per 1GB page: 0.202058 seconds For comparison, when the same 64 GiB of memory was pre-zeroed in advance by the pre-zeroing mechanism, the test completed in negligible time. I will incorporate these findings into the V2 description. Thanks, Zhe