From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15842EE021B for ; Thu, 14 Sep 2023 02:46:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A1A576B0213; Wed, 13 Sep 2023 22:46:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9CA076B0248; Wed, 13 Sep 2023 22:46:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8B93F6B024E; Wed, 13 Sep 2023 22:46:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 7986E6B0213 for ; Wed, 13 Sep 2023 22:46:31 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 538E7120F77 for ; Thu, 14 Sep 2023 02:46:31 +0000 (UTC) X-FDA: 81233664582.05.6C8FA0D Received: from out-223.mta1.migadu.com (out-223.mta1.migadu.com [95.215.58.223]) by imf12.hostedemail.com (Postfix) with ESMTP id 685904000B for ; Thu, 14 Sep 2023 02:46:29 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=oVWKTsKa; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf12.hostedemail.com: domain of muchun.song@linux.dev designates 95.215.58.223 as permitted sender) smtp.mailfrom=muchun.song@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1694659589; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=oNlmK8sw6xG6QY0l/2V8zfE7G5CNskIjBLsl+kdEZH8=; b=usLzdJKvxxnj23zAwaIrK7i4v6ceU8Kd0l9a9LE+jxzqd849DsA9jRr8/6p8fEPYYePFRJ nMXXNGZ5VD1tN6CD6X8fr3TDIoCl5FAAUTgqpGuq3+aD30x5n+RdquV/aFDv8YyybNrJzc 4Q/PlM7F7glHHr/2qthZKanP86G5H0g= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=oVWKTsKa; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf12.hostedemail.com: domain of muchun.song@linux.dev designates 95.215.58.223 as permitted sender) smtp.mailfrom=muchun.song@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694659589; a=rsa-sha256; cv=none; b=xunTo/p5f6RqBpyJznnVTOXtqcbIMqhx9N1/h2Ib0J8tfVweKMB2Tm+c1XWNzoL8QcsRFj 294HwRz0kzyABDGHoUiKd0aFfGQ97gdGk92TjmVf55rsGpcBMWixH3wo5qNUzDbpZNPdOA zLTcQMNU/D2yqStPP4oAqvXpcwhoeIY= Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1694659587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oNlmK8sw6xG6QY0l/2V8zfE7G5CNskIjBLsl+kdEZH8=; b=oVWKTsKacC7sYnt07p2aSlF8q+bWgEwEBN6sdSowILDAjUOlAn15t283+jwi8RghilJxgI gh62f0J6KAFluqC7I1Hf3fGTgD0pKYnkV7IpemQ8yKRCTYLOzEEVysLGHEf/I7kr92kq84 iP4OjlwuJ0XyPhx7XMaDRqEnWbG5nEA= Mime-Version: 1.0 Subject: Re: [v5 4/4] mm: hugetlb: Skip initialization of gigantic tail struct pages if freed by HVO X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: <20230913105401.519709-5-usama.arif@bytedance.com> Date: Thu, 14 Sep 2023 10:45:38 +0800 Cc: Linux-MM , Mike Kravetz , "Mike Rapoport (IBM)" , LKML , Muchun Song , fam.zheng@bytedance.com, liangma@liangbit.com, punit.agrawal@bytedance.com Content-Transfer-Encoding: quoted-printable Message-Id: <53B87FC1-5854-4E54-B28F-C13D3EA662C3@linux.dev> References: <20230913105401.519709-1-usama.arif@bytedance.com> <20230913105401.519709-5-usama.arif@bytedance.com> To: Usama Arif X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: 685904000B X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: scg479i3fiuc6gk9i7gdgfptgm9w5zhy X-HE-Tag: 1694659589-474657 X-HE-Meta: U2FsdGVkX18GjP6i7Qk33onJB4dltNQ1LHVr/wNo68s2p8qwnKxsxrY5HVoqc7sxBjmOBXUux/uGU0ioOTgbytodoIvEr6Szzhty/7qxLkp6+vKicFRdjcS6Man+GPxaqd1bEJekXY6IvUrxda3QCSECIgomi/1CcuzyD+5SbIk+4OW68qUy2KJrBl8rg5JZ8ds0Iv5SciUpVhfvqTZulpaORM5Roxiz5w36Ngh9uSzxNxDDVPQA0JvODOLCLXhURK98jvUU9Bv/Gx3GUvTRHcN/p9tDkA1Ss90uGVczRhcWyk9LHV/UDVByX/YJ4Q1DkLktABogWZIO7mR6cj+JomtgqeZTEIwshDV7uR2au/OTzYt6aP+J/NdEBxe1couwJRRTjz2yELozYyIpLcX2sP05lPuQEOJPfLVVkvR17a1TEPMQbrSNn1KtSTTLwHdYICZx8hfpmdk3da6VvxAM60S3X0AKAUJuNHE2dHnwzE6qR5yPMXq6oLtKTQMe+BpbkZAAW5JjTtGZVIe9QmsZkEdBIXiI6M0YH3gdDhNIsyxFjXjV2LBUgUAkY7iCfHFVQ6YV9UJgo1rg+pdXhoKD2nxN3l7AeLtnsx+NCVaDQTiOYTJNCUWxZWshTqaQKLdAShvxU7oO9NuXz3mItvoU2X00heC39y92MFUHNqD1YDbvku/OG3r8RkBVNwt3iU8vHF5evjwSy+Vb0xKc1IbWwLB/5YCgf+r65F4kGPODgz5bC8uOjRB7hATiOiJPEb+9lcV2iG5R7URWl9tC1+yliv4Eacu4RJ5JMGEc2EjBeJazYT1yE8723c6vPwVwf9pRV5DufrHh29Z7emaop3D7wzKCRTFTx23NhZV80Rh3s8MsptkgM9unu2rUbY2zMhKSSDgCLC2PvK6HQ8T8s1rq6ocFFsfF6JEEWYUZNkmJZRck1qICRiMG5EyOAAQn0vbCB9puHijgu0DEyE8TFIe SkomhUwD o2HnHiN3qT6w0sV9AxnMThkAdhflKSee9RTExB3aG5MS+sjtr2vYP+rdNt4N6R5KXsZtAnnDKLfi0400PW2gdJE3X065gXC4uZQG+VHnC8AhUphPHPwSpDhOFMzRHnSXUi04Qcc8E1VTKxQakmaM0jb2np4BlPj9AclskzILEst/d4g4rv3iqhZBVVW4l1E+C6N4Nssfay1+Nj5OzfmJa8z4EEg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: > On Sep 13, 2023, at 18:54, Usama Arif = wrote: >=20 > The new boot flow when it comes to initialization of gigantic pages > is as follows: > - At boot time, for a gigantic page during __alloc_bootmem_hugepage, > the region after the first struct page is marked as noinit. > - This results in only the first struct page to be > initialized in reserve_bootmem_region. As the tail struct pages are > not initialized at this point, there can be a significant saving > in boot time if HVO succeeds later on. > - Later on in the boot, the head page is prepped and the first > HUGETLB_VMEMMAP_RESERVE_SIZE / sizeof(struct page) - 1 tail struct = pages > are initialized. > - HVO is attempted. If it is not successful, then the rest of the > tail struct pages are initialized. If it is successful, no more > tail struct pages need to be initialized saving significant boot time. >=20 > The WARN_ON for increased ref count in gather_bootmem_prealloc was = changed > to a VM_BUG_ON. This is OK as there should be no speculative = references > this early in boot process. The VM_BUG_ON's are there just in case = such code > is introduced. >=20 > Signed-off-by: Usama Arif Reviewed-by: Muchun Song Thanks for your work.