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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 C862DC63777 for ; Fri, 20 Nov 2020 08:42:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2A54A22244 for ; Fri, 20 Nov 2020 08:42:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="GDiMTJsC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A54A22244 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine 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 840FE6B0036; Fri, 20 Nov 2020 03:42:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7C9246B005C; Fri, 20 Nov 2020 03:42:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 669746B0070; Fri, 20 Nov 2020 03:42:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0005.hostedemail.com [216.40.44.5]) by kanga.kvack.org (Postfix) with ESMTP id 2A06F6B0036 for ; Fri, 20 Nov 2020 03:42:06 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id AF8511EFF for ; Fri, 20 Nov 2020 08:42:05 +0000 (UTC) X-FDA: 77504154210.27.fog00_5616e5b2734a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 93B223D663 for ; Fri, 20 Nov 2020 08:42:05 +0000 (UTC) X-HE-Tag: fog00_5616e5b2734a X-Filterd-Recvd-Size: 4839 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Fri, 20 Nov 2020 08:42:04 +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=1605861723; h=from:from:reply-to: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=MNOFiQtIQ/Y0rDgNN5kTTR1VqVa93kqccMa8KF0RIG4=; b=GDiMTJsC4HaxfVv0+8YSZSejokk+wM15yKilSV79cAMmGEld8iatqZpL7x05RKawd1r7EA CeEXdJtWgXQaKN9jeEQSbHEYtl0KboYq6AM21k4jrWN51rd55Vz+0E3gxx9SL/z3x0Jdle ZWFxIELplvVBCkbBX8K4Z0O/KzYE2B0= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 7DECDACBA; Fri, 20 Nov 2020 08:42:03 +0000 (UTC) Date: Fri, 20 Nov 2020 09:42:02 +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, osalvador@suse.de, song.bao.hua@hisilicon.com, 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 v5 00/21] Free some vmemmap pages of hugetlb page Message-ID: <20201120084202.GJ3200@dhcp22.suse.cz> References: <20201120064325.34492-1-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201120064325.34492-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 Fri 20-11-20 14:43:04, Muchun Song wrote: [...] Thanks for improving the cover letter and providing some numbers. I have only glanced through the patchset because I didn't really have more time to dive depply into them. Overall it looks promissing. To summarize. I would prefer to not have the feature enablement controlled by compile time option and the kernel command line option should be opt-in. I also do not like that freeing the pool can trigger the oom killer or even shut the system down if no oom victim is eligible. One thing that I didn't really get to think hard about is what is the effect of vmemmap manipulation wrt pfn walkers. pfn_to_page can be invalid when racing with the split. How do we enforce that this won't blow up? I have also asked in a previous version whether the vmemmap manipulation should be really unconditional. E.g. shortlived hugetlb pages allocated from the buddy allocator directly rather than for a pool. Maybe it should be restricted for the pool allocation as those are considered long term and therefore the overhead will be amortized and freeing path restrictions better understandable. > Documentation/admin-guide/kernel-parameters.txt | 9 + > Documentation/admin-guide/mm/hugetlbpage.rst | 3 + > arch/x86/include/asm/hugetlb.h | 17 + > arch/x86/include/asm/pgtable_64_types.h | 8 + > arch/x86/mm/init_64.c | 7 +- > fs/Kconfig | 14 + > include/linux/bootmem_info.h | 78 +++ > include/linux/hugetlb.h | 19 + > include/linux/hugetlb_cgroup.h | 15 +- > include/linux/memory_hotplug.h | 27 - > mm/Makefile | 2 + > mm/bootmem_info.c | 124 ++++ > mm/hugetlb.c | 163 ++++- > mm/hugetlb_vmemmap.c | 765 ++++++++++++++++++++++++ > mm/hugetlb_vmemmap.h | 103 ++++ I will need to look closer but I suspect that a non-trivial part of the vmemmap manipulation really belongs to mm/sparse-vmemmap.c because the split and remapping shouldn't really be hugetlb specific. Sure hugetlb knows how to split but all the splitting should be implemented in vmemmap proper. > mm/memory_hotplug.c | 116 ---- > mm/sparse.c | 5 +- > 17 files changed, 1295 insertions(+), 180 deletions(-) > create mode 100644 include/linux/bootmem_info.h > create mode 100644 mm/bootmem_info.c > create mode 100644 mm/hugetlb_vmemmap.c > create mode 100644 mm/hugetlb_vmemmap.h Thanks! -- Michal Hocko SUSE Labs