Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3663324rdb; Wed, 13 Sep 2023 21:09:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJbYQKoZ8863gUPbxq50k75gqVmL1L5W80tmSD2Nu8nRTY4j28aOPd2157dnmme3hahH8b X-Received: by 2002:a17:902:d512:b0:1b3:8862:9823 with SMTP id b18-20020a170902d51200b001b388629823mr5320636plg.28.1694664545848; Wed, 13 Sep 2023 21:09:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694664545; cv=none; d=google.com; s=arc-20160816; b=vW7MenMyoesRdN7O8IUrPmK2wXCzo7hjygZvKrOI+JmR8snlfQoof6heR3bf6eEE2h NDQ655MP/47yexAoxZHKTf2rRNsVCBdf/qHLR3QXnz6oFVJf1p+a54A3D//Ip5Q+zh5R /bT9DDjt/2GLjiaG0Q+ijxZELF/0HSLjy7wjcuRS/i9l/TEpqLppYbebvfcXfzd1lPPf GcFKdOApvGXjS4H65AB2LPMlBE1YCyJaga4ug5Nz2l7EufCqL5WgSZdKUYfWxF68st1s 1DYCv4X8zSmgiU30rik1ed51dg11+eE3QT9FRBiS/6/89r15EMm9nkK/r5HM7m7X/1j4 Z9TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=oNlmK8sw6xG6QY0l/2V8zfE7G5CNskIjBLsl+kdEZH8=; fh=UFxuqb81Ob8gWwRxGE7A7tewhdba66WhaZxys7dk2Is=; b=KhF7jzcPDX3o3I1c682VNsN4xexjYP4FpVD0TrlKQcLpw1CuZzl+WpZaDZaUv6v1b0 CVp/SU8BfWuD7BAGG8P1EDpMqFVKaeSErhlEswwO4Py1EH69qy5i9TVpzm0rMsAgGR5s U90HYhptPK91F7tN8N2lTfI74GVCSgLbN2+MGHBOipFhQR/HlZ7gV3sFUfSKFFjm2EYK r4BxB3CZTIFCdEpoyHIcTGj5hGmwXYHcsK0XhHyUL/8yxO/dT03RTf4a+UkYjaHJQP9y BhnuTgWsaS3zhqFMDYDyz09vD63P2NtEeX8VIdlHevq0kLBZTp2cijkdMe/USr3RfnU1 oe3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=oVWKTsKa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id k4-20020a170902c40400b001bc8af2bc6bsi883426plk.170.2023.09.13.21.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 21:09:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=oVWKTsKa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 943E28076D1C; Wed, 13 Sep 2023 19:46:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233710AbjINCqe (ORCPT + 99 others); Wed, 13 Sep 2023 22:46:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229669AbjINCqc (ORCPT ); Wed, 13 Sep 2023 22:46:32 -0400 Received: from out-222.mta1.migadu.com (out-222.mta1.migadu.com [95.215.58.222]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5E1110C3 for ; Wed, 13 Sep 2023 19:46:28 -0700 (PDT) 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 13 Sep 2023 19:46:39 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email > 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.