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.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 76BBCC56201 for ; Fri, 30 Oct 2020 09:15:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BF88F20728 for ; Fri, 30 Oct 2020 09:15:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="q7TfBcI4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF88F20728 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CB78F6B005C; Fri, 30 Oct 2020 05:15:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C66426B005D; Fri, 30 Oct 2020 05:15:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BA4966B0062; Fri, 30 Oct 2020 05:15:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0062.hostedemail.com [216.40.44.62]) by kanga.kvack.org (Postfix) with ESMTP id 8A9646B005C for ; Fri, 30 Oct 2020 05:15:01 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 24CED8249980 for ; Fri, 30 Oct 2020 09:15:01 +0000 (UTC) X-FDA: 77428032402.15.paper01_63123a227294 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id EF5F01814B0C9 for ; Fri, 30 Oct 2020 09:15:00 +0000 (UTC) X-HE-Tag: paper01_63123a227294 X-Filterd-Recvd-Size: 3050 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Fri, 30 Oct 2020 09:15:00 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1604049299; 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: in-reply-to:in-reply-to:references:references; bh=EfN1LEPDQQrCoeNpouMKenj2gqt+0jwF5CDIrEYva5o=; b=q7TfBcI4eS1iDErBTa1jW+j0t/DPQOdxbihxnM0kHmI4wW08NtMFb7qJXO6QW/2t70oHUA 3UBNWjnkVIC6C14TPAXzV1sNwqLK/l28bvD01lu9Cv8ataUtQSpwSk63wVflfWVvxzqxEi oBclMLQzKTnqLhHFCJ7y1Y3vpix+kOY= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 37793AD19; Fri, 30 Oct 2020 09:14:59 +0000 (UTC) Date: Fri, 30 Oct 2020 10:14:45 +0100 From: Michal Hocko 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, duanxiongchun@bytedance.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2 00/19] Free some vmemmap pages of hugetlb page Message-ID: <20201030091445.GF1478@dhcp22.suse.cz> References: <20201026145114.59424-1-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201026145114.59424-1-songmuchun@bytedance.com> 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 Mon 26-10-20 22:50:55, Muchun Song wrote: > If we uses the 1G hugetlbpage, we can save 4095 pages. This is a very > substantial gain. On our server, run some SPDK/QEMU applications which > will use 1000GB hugetlbpage. With this feature enabled, we can save > ~16GB(1G hugepage)/~11GB(2MB hugepage) memory. [...] > 15 files changed, 1091 insertions(+), 165 deletions(-) > create mode 100644 include/linux/bootmem_info.h > create mode 100644 mm/bootmem_info.c This is a neat idea but the code footprint is really non trivial. To a very tricky code which hugetlb is unfortunately. Saving 1,6% of memory is definitely interesting especially for 1GB pages which tend to be more static and where the savings are more visible. Anyway, I haven't seen any runtime overhead analysis here. What is the price to modify the vmemmap page tables and make them pte rather than pmd based (especially for 2MB hugetlb). Also, how expensive is the vmemmap page tables reconstruction on the freeing path? Thanks! -- Michal Hocko SUSE Labs