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=-15.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 46FFAC433ED for ; Wed, 19 May 2021 13:06:10 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 063CD61353 for ; Wed, 19 May 2021 13:06:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 063CD61353 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=sBhqVogP/yo0sTzVja29vXYAFfpP3tUPlhTp67cjR9w=; b=oFgo4+mxP8kJYU1LPO3Fsfx4+ Go1tfeavTjs+11f5spOfDKRr8YZqIsWqquraQ92SE3DwxRLaDG3Q81HrleMH2QbsP8GO1t5KJ4kuq ZGvTz+58hT+Oc1WORU94VfCXxxvYzt9U21rlbJSx7WfLdTka/L1FfhiRFveHB+g7akQRVFjpgsfey eHrH8mcjtE1Io4qRqK35CmdxRQyw0HPVPMFIDCsT1UR5NU3Aj6RRbyWJBJ159WnulKZsHGOa+rCUG NoHYzxCh6RBmF0N2ccM7BqB8qtopP3CZo1Lqs4pV5x66fQxrUerzn8MAQ9TyYiJtUxyIXhELEexRd 4bVTM/Jjw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1ljLrw-00412i-Kb; Wed, 19 May 2021 13:04:12 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljLQR-003vTs-0X for linux-arm-kernel@desiato.infradead.org; Wed, 19 May 2021 12:35:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=Ez+G5yhy8ZhGk0r91B/Dxqw0WtvYoCZsJ+nckBQtz9k=; b=gr+rOHXVvuo6RXzVyZg01FBwUK za+85NNQCw3RSrHQgKkWJvLF0vdvp/IrLDfevxlOruzQNxbMhMnSYIGp5iuDoTZDpbc0UtUqklTdC SF4+Jh2LkKJQAM+ofcXi8NkQ4g3T/c8bGxvkMwm/2MdfYCMNWB/9jVUj8RDsKKv4tVOx7YvE+YINu J3Uxd+Q9nJDFiBQh4342b4QYHn5vmd2sC5zkQ76mtUy8lhepXXd6uPSnhArhOT1YSFiFXqypxAJJc TFNk8nDxVjW+WnKXvTX3SkvokSNeXWqvdMYBdApGjiPDXw6TBnc4Dxe8Lv+U1+bS1o/eVoZYcMgif EjwNk+hg==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1ljLQO-00FSPx-BA for linux-arm-kernel@lists.infradead.org; Wed, 19 May 2021 12:35:45 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 803D5101E; Wed, 19 May 2021 05:35:41 -0700 (PDT) Received: from [10.163.79.253] (unknown [10.163.79.253]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 33E683F73B; Wed, 19 May 2021 05:35:36 -0700 (PDT) Subject: Re: [PATCH] arm64: mm: hugetlb: add support for free vmemmap pages of HugeTLB To: Muchun Song , will@kernel.org, akpm@linux-foundation.org, david@redhat.com, bodeddub@amazon.com, osalvador@suse.de, mike.kravetz@oracle.com, rientjes@google.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, zhengqi.arch@bytedance.com References: <20210518091826.36937-1-songmuchun@bytedance.com> From: Anshuman Khandual Message-ID: <5ae7a4be-dfd5-faf6-a75c-a2adf5a344b2@arm.com> Date: Wed, 19 May 2021 18:06:21 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210518091826.36937-1-songmuchun@bytedance.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210519_053544_462308_91CC5553 X-CRM114-Status: GOOD ( 19.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 5/18/21 2:48 PM, Muchun Song wrote: > The preparation of supporting freeing vmemmap associated with each > HugeTLB page is ready, so we can support this feature for arm64. > > Signed-off-by: Muchun Song > --- > arch/arm64/mm/mmu.c | 5 +++++ > fs/Kconfig | 2 +- > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c > index 5d37e461c41f..967b01ce468d 100644 > --- a/arch/arm64/mm/mmu.c > +++ b/arch/arm64/mm/mmu.c > @@ -23,6 +23,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -1134,6 +1135,10 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node, > pmd_t *pmdp; > > WARN_ON((start < VMEMMAP_START) || (end > VMEMMAP_END)); > + > + if (is_hugetlb_free_vmemmap_enabled() && !altmap) > + return vmemmap_populate_basepages(start, end, node, altmap); > + > do { > next = pmd_addr_end(addr, end); > > diff --git a/fs/Kconfig b/fs/Kconfig > index 6ce6fdac00a3..02c2d3bf1cb8 100644 > --- a/fs/Kconfig > +++ b/fs/Kconfig > @@ -242,7 +242,7 @@ config HUGETLB_PAGE > > config HUGETLB_PAGE_FREE_VMEMMAP > def_bool HUGETLB_PAGE > - depends on X86_64 > + depends on X86_64 || ARM64 > depends on SPARSEMEM_VMEMMAP > > config MEMFD_CREATE > How does this interact with HugeTLB migration as such which might iterate over individual constituent struct pages (overriding the same struct page for all tail pages when this feature is enabled). A simple test involving madvise(ptr, size, MADV_SOFT_OFFLINE) fails on various HugeTLB page sizes, with this patch applied. Although I have not debugged this any further. Soft offlining pfn 0x101c00 at process virtual address 0xffff7fa00000 soft offline: 0x101c00: hugepage migration failed 1, type bfffc0000010006 (referenced|uptodate|head|node=0|zone=2|lastcpupid=0xffff) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel