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 X-Spam-Level: X-Spam-Status: No, score=-7.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEB84C433DB for ; Thu, 4 Mar 2021 05:06:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 47CD964EFE for ; Thu, 4 Mar 2021 05:06:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 47CD964EFE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 849026B0007; Thu, 4 Mar 2021 00:06:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7F8EA6B0008; Thu, 4 Mar 2021 00:06:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 672C16B000A; Thu, 4 Mar 2021 00:06:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0162.hostedemail.com [216.40.44.162]) by kanga.kvack.org (Postfix) with ESMTP id 49A1A6B0007 for ; Thu, 4 Mar 2021 00:06:26 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id F0974442B for ; Thu, 4 Mar 2021 05:06:25 +0000 (UTC) X-FDA: 77881005930.29.EA31A2D Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by imf17.hostedemail.com (Postfix) with ESMTP id 4746440001DE for ; Thu, 4 Mar 2021 05:06:25 +0000 (UTC) Received: by mail-pl1-f177.google.com with SMTP id g20so15467887plo.2 for ; Wed, 03 Mar 2021 21:06:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=emvx6EGccNj6Ydsl4VIT/MapySsYN/1eggzsPky2Bqg=; b=AlGlq+xLEuvo/Vc+kPNJEBcVKI/sHnodi8Jx8UTm4EaWSUtECl+ig6dpsb2yNshbXH P627aXAL3t6+GWqIWlyn/c76pLoZcKFxde/drVkpjKfo4fF/rkMZ394mO8FKvXGz+H4j pcKhEwQR7VfbE4H2XnDVSJK4Up/gwTqx3OenSIj5l1yXSj5pZY4XIHkmh0tVuqkApwc3 qJZ8Bsj43FKTseZRq+ks68ssiovr2xsMWf6IF7aMD0UiwQ1WCkMsD6w6eU5drZvOKDhM KfM3J8w7XzM+QfvnB9EANNKG/FYPMPsGv2IlJIlaY57KoHPhCjeb8r75fS3pVYdS5eW7 arTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=emvx6EGccNj6Ydsl4VIT/MapySsYN/1eggzsPky2Bqg=; b=M8w+7+ykA3n1dXHOpZl7Ue4n+HQmnyq77+Dq4PcvBc3k2oWwMyPuoAwO6Hfd73tr+6 sNpAkGBpl1twfPMJMAG+/JYJ5Js+PW6pcuOzfYqSmXU4bEQxXClUKQ2hYEOppLBFOcRW x9eRom+ujk51bEk5L6SBQX/RG/x0BcdJF1pudnADloXQdpni4ZyJfVxkOZGqjaE689WO gORfEMRCTpV3CcogJ2lvr1yiW9u6m3V03UFVX4kDo4MXdTVCF21hNv0uQGDfQ7hJl8fs mEez00D6NauAVYZYyn3UI4Rf45EYZAy5qmFZeavkmsWAbtoHb6m2y1gYSHP+hzMiEF6H UiSQ== X-Gm-Message-State: AOAM5339lga8cjXgcQy6uCSidWnTKwrcxet2tAzCSw5bZKAYr2zqA4UX 3TEfmEcMw4HkA0ukH4Uugog= X-Google-Smtp-Source: ABdhPJzjrm43e7Byowg0g5bCTtT6JJKmNM5oQ0ifxTHweqTpc+KNPB9SmA1zgtUxtn+T2FeMn1vjAQ== X-Received: by 2002:a17:90a:a384:: with SMTP id x4mr2648884pjp.84.1614834384259; Wed, 03 Mar 2021 21:06:24 -0800 (PST) Received: from localhost (121-45-173-48.tpgi.com.au. [121.45.173.48]) by smtp.gmail.com with ESMTPSA id a3sm433368pfi.206.2021.03.03.21.06.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 21:06:22 -0800 (PST) Date: Thu, 4 Mar 2021 16:06:19 +1100 From: Balbir Singh To: Muchun Song Cc: corbet@lwn.net, mike.kravetz@oracle.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, paulmck@kernel.org, mchehab+huawei@kernel.org, pawan.kumar.gupta@linux.intel.com, rdunlap@infradead.org, oneukum@suse.com, anshuman.khandual@arm.com, jroedel@suse.de, almasrymina@google.com, rientjes@google.com, willy@infradead.org, osalvador@suse.de, mhocko@suse.com, song.bao.hua@hisilicon.com, david@redhat.com, naoya.horiguchi@nec.com, joao.m.martins@oracle.com, duanxiongchun@bytedance.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Miaohe Lin Subject: Re: [PATCH v17 2/9] mm: hugetlb: introduce a new config HUGETLB_PAGE_FREE_VMEMMAP Message-ID: <20210304050619.GC1223287@balbir-desktop> References: <20210225132130.26451-1-songmuchun@bytedance.com> <20210225132130.26451-3-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210225132130.26451-3-songmuchun@bytedance.com> X-Stat-Signature: 5q968ax4s576qa5si9ox8stezzp85noi X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 4746440001DE Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf17; identity=mailfrom; envelope-from=""; helo=mail-pl1-f177.google.com; client-ip=209.85.214.177 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614834385-616931 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 Thu, Feb 25, 2021 at 09:21:23PM +0800, Muchun Song wrote: > The option HUGETLB_PAGE_FREE_VMEMMAP allows for the freeing of > some vmemmap pages associated with pre-allocated HugeTLB pages. > For example, on X86_64 6 vmemmap pages of size 4KB each can be > saved for each 2MB HugeTLB page. 4094 vmemmap pages of size 4KB > each can be saved for each 1GB HugeTLB page. > > When a HugeTLB page is allocated or freed, the vmemmap array > representing the range associated with the page will need to be > remapped. When a page is allocated, vmemmap pages are freed > after remapping. When a page is freed, previously discarded > vmemmap pages must be allocated before remapping. > > The config option is introduced early so that supporting code > can be written to depend on the option. The initial version of > the code only provides support for x86-64. > > Like other code which frees vmemmap, this config option depends on > HAVE_BOOTMEM_INFO_NODE. The routine register_page_bootmem_info() is > used to register bootmem info. Therefore, make sure > register_page_bootmem_info is enabled if HUGETLB_PAGE_FREE_VMEMMAP > is defined. > > Signed-off-by: Muchun Song > Reviewed-by: Oscar Salvador > Acked-by: Mike Kravetz > Reviewed-by: Miaohe Lin > --- Reviewed-by: Balbir Singh