Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1241622pxb; Thu, 4 Mar 2021 06:55:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJwLlCAqqvByRH7vWoUi5tvOo45ZXa4oD9Vp7gRrYxrH2Sq+yUxJb9swUQJYxIyAilEsSbO6 X-Received: by 2002:a17:906:400b:: with SMTP id v11mr4672620ejj.194.1614869707061; Thu, 04 Mar 2021 06:55:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614869707; cv=none; d=google.com; s=arc-20160816; b=ozji8A0WR+tKIGJUV2pBc2fZKlVNfyqpf9UclM2a6rsWIWs1PqBKG1pZiR1GXp3Dk1 89nVBHESCoHRtKTGBUwkaDjbADpSc+CDcaUanauji6AAcc56OJJcc3ryYtrmxPon0TOL 9I9kBjUgQr/5rzXEIljs8ZUwYD5YNJOKZ12VFUtdVVJZ2TXpAXXTDgW9U5z89sCkTXHp TJMSBuYZd1lSabL/uqEx4QPDnFlwlXn7ReJWFfxkdnccfN8mgoiQjE4UEup1PUGHxtKV NGtxPWA/y1CQzLSUb+60UQcenF3S63UnYrUuCaT5aDaZ6OwsyCqTkvQHfLc0mnTn2oPc VycQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=emvx6EGccNj6Ydsl4VIT/MapySsYN/1eggzsPky2Bqg=; b=WQ82i4/9YbOeVyUYnBqrDqMbSUmzmpdNsy3TBeGAGDkQ3OctiQiodcf54nVAmz5lLK 3i0G10KVXjys4ZU4sP5h2qq/bccQpBMjh4/AQY0CY+bNTm4iyu1gsn5ZNweBgV4d95xH iuIRNpEh65M4ruchYuZ+nsOBIFVQaionQ7f6I+G41Kqfo2X6M95sLPPH6PZlklse+1gr vqW7horbXaV84aulyICMSYO9Fg6fuyzBU8BasTmUJOi1LDxW393K+9VYK+CNcETjFoG1 ranW3ZXFTqp8vZFiWM6bFlBL0IctzbycgaeEx48WpwWp1JoLWuIf4yC8FAyg3PcdxqhL q1Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AlGlq+xL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g12si16932873ejd.256.2021.03.04.06.54.42; Thu, 04 Mar 2021 06:55:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AlGlq+xL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229798AbhCDFHg (ORCPT + 99 others); Thu, 4 Mar 2021 00:07:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229760AbhCDFHF (ORCPT ); Thu, 4 Mar 2021 00:07:05 -0500 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E826DC061574; Wed, 3 Mar 2021 21:06:24 -0800 (PST) Received: by mail-pl1-x62a.google.com with SMTP id d8so5030975plg.10; Wed, 03 Mar 2021 21:06:24 -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=P/amwh10QL1V90mkvxaeDWV5Uir0jERBYZOOlvTgMkJyVNqoWCogCX1RbgZs8HmLnb r2bFDV3YRbfL5aQYfPyKGRGIPfaBeaRuhbk1d7FOE2Hi5lRVlSto7esUQIeogNkh94Y9 k0xXeUHwcjWcqyGFO5bxIZuBWMdDdqYwoY3iRDtqPfJtS2a14V8jngRI016fG6A+CTzR Lhze9+jHt1rzhYntkWVLQBPax/tkt8e6EM/E+h8kLx9W24wmmuDtEWQ+dOAxjrzk3jWe KC80i/wHaVEAsl1qxiwj2aMOb78UThF8nX1521XdP51k4ggXe0eGJZ6racsjoZUD9yhM QQjA== X-Gm-Message-State: AOAM532MaIQSt10ucKlTG/ngrSEHqNBrNvDBGdSFtlTH7OEGEswMuo7t kbb8m0mnfsA0fMvaInVSkLY= 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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