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.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 DE5FEC433B4 for ; Wed, 19 May 2021 12:03:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7A3FD61040 for ; Wed, 19 May 2021 12:03:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A3FD61040 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D3E2C6B0073; Wed, 19 May 2021 08:03:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CECA06B0074; Wed, 19 May 2021 08:03:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B194C6B0075; Wed, 19 May 2021 08:03:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0169.hostedemail.com [216.40.44.169]) by kanga.kvack.org (Postfix) with ESMTP id 7CC0D6B0073 for ; Wed, 19 May 2021 08:03:29 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 17075180AD830 for ; Wed, 19 May 2021 12:03:29 +0000 (UTC) X-FDA: 78157845738.06.FED313A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf14.hostedemail.com (Postfix) with ESMTP id 4B011C0042CC for ; Wed, 19 May 2021 12:03:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621425808; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C2tITqJSuYbvq+jsZJ9sBCe2doWKAdm3TnmWMpGg4/0=; b=YIrpZ7uoo8OhSOJoSa6JlFOLx0vJNcFd6uPGnui3yp0mocEzU+n/7zCik0IF4ZMhHksguX o9XCLmJkUeD/YCGGdTWaRdBEw3RotkHmcym7aLsSPloWvKCQerjneG7kJTI2eduAgWI+Yk nN3MDlLognAdh+tFpXNEmGTZ8FzPakw= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-195-n9b95YdXOiyMEY3Z_lNPDA-1; Wed, 19 May 2021 08:03:26 -0400 X-MC-Unique: n9b95YdXOiyMEY3Z_lNPDA-1 Received: by mail-wm1-f70.google.com with SMTP id y193-20020a1c32ca0000b029014cbf30c3f2so1452489wmy.1 for ; Wed, 19 May 2021 05:03:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:organization:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=C2tITqJSuYbvq+jsZJ9sBCe2doWKAdm3TnmWMpGg4/0=; b=C4wDGUF2EtV8IwjjnAPZk3yRQcJFXfJX7FIq3kFjYUOsmSEf86h8GeTnGbYxIwKtHD D6ayua72olx03FcYdSpoLq9dxJqkKcEJtKWftN3nWAeO6xbcrIMDVBixedV2r/CtBJdD Q5L6V2qdY0lp0zKRtZKDfBCgIiINpspUxqEHnfsspF0fn3FS9Eil+amCzNYlkBypUidl KYULwvWHvUHD4oPDqwJNIGrfUbr9rIIHFA+qcGd90dyAYN3YCryEEtSFxWMVzjKKPQnb a955tMxRIrjM58+GoNkn3zTZZwpKfE4LgWmGJZuTzgkLlxbNd6Oz9cNXwuzFYpQl6wGC q5zA== X-Gm-Message-State: AOAM532VwPNmkCJItvm0OR+hT2G0HafBaHyawlNUU/iOVl69/b6u62/7 hBcIE/BiWbbOlxS2A6gWpqSyXZbS3l/ZdPG6FpYV6YhWKtVt51jwJtmVS8sVMEJ55L0NsdFTP5s mLoG4bzES1Jk= X-Received: by 2002:a05:600c:218c:: with SMTP id e12mr10837520wme.16.1621425805140; Wed, 19 May 2021 05:03:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUbn7Icj3cLTs0K75jizldDb0dn/E0PcCqSEvXVbxyqNjMn+DSAD0c6hFvb3EV1mBLD2Bw+g== X-Received: by 2002:a05:600c:218c:: with SMTP id e12mr10837476wme.16.1621425804863; Wed, 19 May 2021 05:03:24 -0700 (PDT) Received: from [192.168.3.132] (p5b0c6694.dip0.t-ipconnect.de. [91.12.102.148]) by smtp.gmail.com with ESMTPSA id w25sm20593966wmk.25.2021.05.19.05.03.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 May 2021 05:03:24 -0700 (PDT) To: Anshuman Khandual , Muchun Song , will@kernel.org, akpm@linux-foundation.org, 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> <1b9d008a-7544-cc85-5c2f-532b984eb5b5@arm.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH] arm64: mm: hugetlb: add support for free vmemmap pages of HugeTLB Message-ID: <88114091-fbb2-340d-b69b-a572fa340265@redhat.com> Date: Wed, 19 May 2021 14:03:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <1b9d008a-7544-cc85-5c2f-532b984eb5b5@arm.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YIrpZ7uo; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf14.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=david@redhat.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 4B011C0042CC X-Stat-Signature: ugqkm7jfm8myny9bxwptbakec3drsr4x X-HE-Tag: 1621425807-606596 Content-Transfer-Encoding: quoted-printable 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 19.05.21 13:45, Anshuman Khandual wrote: >=20 >=20 > 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 >> =20 >> #include >> #include >> @@ -1134,6 +1135,10 @@ int __meminit vmemmap_populate(unsigned long st= art, unsigned long end, int node, >> pmd_t *pmdp; >> =20 >> WARN_ON((start < VMEMMAP_START) || (end > VMEMMAP_END)); >> + >> + if (is_hugetlb_free_vmemmap_enabled() && !altmap) >> + return vmemmap_populate_basepages(start, end, node, altmap); >=20 > Not considering the fact that this will force the kernel to have only > base page size mapping for vmemmap (unless altmap is also requested) > which might reduce the performance, it also enables vmemmap mapping to > be teared down or build up at runtime which could potentially collide > with other kernel page table walkers like ptdump or memory hotremove > operation ! How those possible collisions are protected right now ? Hi Anshuman, Memory hotremove is not an issue IIRC. At the time memory is removed,=20 all huge pages either have been migrated away or dissolved; the vmemmap=20 is stable. vmemmap access (accessing the memmap via a virtual address) itself is=20 not an issue. Manually walking (vmemmap) page tables might behave=20 differently, not sure if ptdump would require any synchronization. >=20 > Does not this vmemmap operation increase latency for HugeTLB usage ? > Should not this runtime enablement also take into account some other > qualifying information apart from potential memory save from struct > page areas. Just wondering. That's one of the reasons why it explicitly has to be enabled by an admin= . --=20 Thanks, David / dhildenb