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=-3.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 C1418C4361B for ; Thu, 17 Dec 2020 15:52:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6438623977 for ; Thu, 17 Dec 2020 15:52:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6438623977 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 919C28D0002; Thu, 17 Dec 2020 10:52:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8C9628D0001; Thu, 17 Dec 2020 10:52:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 807D98D0002; Thu, 17 Dec 2020 10:52:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0246.hostedemail.com [216.40.44.246]) by kanga.kvack.org (Postfix) with ESMTP id 6B7C38D0001 for ; Thu, 17 Dec 2020 10:52:48 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 37D981DF3 for ; Thu, 17 Dec 2020 15:52:48 +0000 (UTC) X-FDA: 77603217216.11.cough15_4a116d927436 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id 0E1EB180F8B80 for ; Thu, 17 Dec 2020 15:52:48 +0000 (UTC) X-HE-Tag: cough15_4a116d927436 X-Filterd-Recvd-Size: 4617 Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Thu, 17 Dec 2020 15:52:47 +0000 (UTC) Received: by mail-pg1-f177.google.com with SMTP id i7so8900885pgc.8 for ; Thu, 17 Dec 2020 07:52:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7OV9R4drFVeTku6dunPe0dURgcLywII3vMyOLzHOjbo=; b=yIBLJwwwDEHWJYBXBXaDOCOIOlu1mzIWwwnbbYQQfRQ7LMkU8qv2JkgGg26nogIKSs gxn3EeARR2JyL2paSPPTy8ZZOLVboX9eX3dPocdwjayLq4ljEaMz9tUUS7eoFsq61rpO vQfCxyF+sy1wilxSU4GP9nCyRGicjzMz1xnoQ5CSZOMcjYmsIGmlIfL59XL6Sj/+js1P llf3TuHQXpH+jtwajIkC0hNlgujwNjiNEXG1kNvJwQVxRQj34fRA2bjR1G1wYaPUkZUf aD3n/TscPNVA97au0sGrkDHWaARlvnOewXs22G5Iewdj4dM7VdJHL6fzM0jp1uJZ1kDq N8Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7OV9R4drFVeTku6dunPe0dURgcLywII3vMyOLzHOjbo=; b=VpDxKjRT02SUs/EMOnvA/KyMdeB3hHWAIV8+J7niWw2/cvH9Vib6DreVtIh3RhjlBV RGbM31B6zEdrbgxsIAfNxbppoRSnT6AZ2mFWeVaJYGpB/TTzJELC3pSEidAB/M+60qUk N3QwBcgZ5knNlw01SA0EVNTLYBzK9gpxpubR8xDaXYYkYuZYB5emJPnVNEhkaZCtRn4Z dn8cQcFzkooQW8aU5kbLSg9fkpDdPqfYhk5MS0PIqyUUFdI9uqiyih4nme6w69FpJl2n NGJjBIOhfI6NulubAMsLV/4ZG/ZQBlDuZK9bKq3q8SPc+wPq91R75XkhQrzfxoIpsY/R pO8A== X-Gm-Message-State: AOAM531HxDdACOlFLFcyxeEnNevT7M0WOTikyG0szOoXssJ1PCS1+ZDv Qu2KPw/UJ9Mo/SMmWcDRGBr3X2bP4U1/MAMtq7whtA== X-Google-Smtp-Source: ABdhPJyTI/Q5bVzBSZ27aLlJM/iDQhjOE7mhc5Lg63MoMB/+jhXY3WlVE+4+B5+ELdOXR7SAXo9VOCUMfJ9+AK6tiv8= X-Received: by 2002:aa7:979d:0:b029:1a4:3b76:a559 with SMTP id o29-20020aa7979d0000b02901a43b76a559mr22509754pfp.49.1608220366075; Thu, 17 Dec 2020 07:52:46 -0800 (PST) MIME-Version: 1.0 References: <20201217121303.13386-1-songmuchun@bytedance.com> <20201217145953.GA13874@linux> In-Reply-To: <20201217145953.GA13874@linux> From: Muchun Song Date: Thu, 17 Dec 2020 23:52:09 +0800 Message-ID: Subject: Re: [External] Re: [PATCH v10 00/11] Free some vmemmap pages of HugeTLB page To: Oscar Salvador Cc: Jonathan Corbet , Mike Kravetz , Thomas Gleixner , mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, dave.hansen@linux.intel.com, luto@kernel.org, Peter Zijlstra , viro@zeniv.linux.org.uk, Andrew Morton , paulmck@kernel.org, mchehab+huawei@kernel.org, pawan.kumar.gupta@linux.intel.com, Randy Dunlap , oneukum@suse.com, anshuman.khandual@arm.com, jroedel@suse.de, Mina Almasry , David Rientjes , Matthew Wilcox , Michal Hocko , "Song Bao Hua (Barry Song)" , David Hildenbrand , naoya.horiguchi@nec.com, Xiongchun duan , linux-doc@vger.kernel.org, LKML , Linux Memory Management List , linux-fsdevel Content-Type: text/plain; charset="UTF-8" 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, Dec 17, 2020 at 11:00 PM Oscar Salvador wrote: > > On Thu, Dec 17, 2020 at 08:12:52PM +0800, Muchun Song wrote: > > In this case, for the 1GB HugeTLB page, we can save 4088 pages(There are > > 4096 pages for struct page structs, we reserve 2 pages for vmemmap and 8 > > pages for page tables. So we can save 4088 pages). This is a very substantial > > gain. On our server, run some SPDK/QEMU applications which will use 1024GB > > hugetlbpage. With this feature enabled, we can save ~16GB(1G hugepage)/~11GB > > (2MB hugepage, the worst case is 10GB while the best is 12GB) memory. > > Is the above really true? > We no longer need to allocate pagetables, so the savings go up to 4094, right? Yeah, you are right. I forget to update this. > > I will be off for a few days but I expect to get back to this and review the > missing bits when I am back. > Thanks. > -- > Oscar Salvador > SUSE L3 -- Yours, Muchun