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=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 20378C433B4 for ; Wed, 19 May 2021 12:05:47 +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 AA6F1611AE for ; Wed, 19 May 2021 12:05:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA6F1611AE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:Subject: From:References:Cc:To:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zxpPL09BvoW1g1EY4DPsEb7n2+GBkA+7PKhUY4NejNY=; b=U2vqmfyua5D1vkqm4OvLPlCY9 Tp/CT9OHZS+G8TP/bIWS7Kgu3cUFyv/JksMFnZEK9vbf3ACANh3EZZQNDSbfti7rvdmxhUIsZ656Z nXjyceiSwSpGlaR+UUdm/NkbrD6n4pVweRBigJKB3VG3PB5NVJgeaGLZEai5V6njLFihEc5Br6Ggk XqVbvenja1yAH/jltosSAcAxbagoSDGQ3eQJ53aBhm6GC9zJcj8+9ZNtKI/zkqEiJ/N+rd469UTaC IYyTdM8HrvCttQkrfalWfsJmOCDBKQ5hWPOsE0B7dlD28Nyjvt8pGOF0XjMJ+calVMW8wbMWhK6J1 TzxvEp6Fw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1ljKvJ-003s9P-0v; Wed, 19 May 2021 12:03:37 +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 1ljKvF-003s9B-Pc for linux-arm-kernel@desiato.infradead.org; Wed, 19 May 2021 12:03:34 +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:Subject:From:References :Cc:To:Sender:Reply-To:Content-ID:Content-Description; bh=C2tITqJSuYbvq+jsZJ9sBCe2doWKAdm3TnmWMpGg4/0=; b=0UBw4w+byK2O+nUs9cLheoMo2e +1ogA9Ltn6IfbqW/jXRdAYm0Xyup4Wp+1bWSjblA0PuznETupSd5NTussS2lPnaaO2AgGVolWd3QD tzoFZvTlhc7tQDKTLA8mjH1W+2H1nTxuhtfR+DhQAhshJFRU/ldc21ksA8DuspW8D2ktOeer9X6PD XmthkSeZPoy6hn3fi9w6leTp9e/RRhTAMBtPTCDGwnIhn5DCmDmXsfL1czcdDHRqhYsbwkmmeyWLp +BVfqr6ZJsgHNko0ijx4cLo0I7AVZBAew8S93hBK0IJmICJzN/6degwBFZKywcUlKzNIpQas9kP2T G3djkgAA==; Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljKvC-00FR3S-Fh for linux-arm-kernel@lists.infradead.org; Wed, 19 May 2021 12:03:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621425807; 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=X4b+gY5c0RjprC3urjmnxWlhElpP3X2SXanYqYKFW/c/zod/1HWrh4K92tXnOgm75QN94p 5AsvlZgKmOlpi372sh4MdCGFd0nyaX/j7pe5f1rtPb71IEKgzyebj9SDV8W2G3ynBNd276 L0PyYrR+7NwH675X/Az+w+gLV9OGmY0= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-124-D1JcJ3p4MB2Y4a4uiJkKYg-1; Wed, 19 May 2021 08:03:26 -0400 X-MC-Unique: D1JcJ3p4MB2Y4a4uiJkKYg-1 Received: by mail-wr1-f69.google.com with SMTP id t5-20020adfb7c50000b029010dd0bb24cfso7069617wre.2 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=EGc1vB2Y4GS2U4QcwYJ1wTq89gRLTTF4tSgcAjmhU98QiZI8elN2j33cM4RblS9ul+ bfVoHKUiHmEtgaRcxQjiFiyV4BApq+OJ6k6aRUoWNhZcFhCFkeAWNp743p2qXiRd73iL BWOAC+SNlGlCZwAH/2S8Dz+eVNrJkzoW4xAnIdnhpf3J36lZKhj/FSYzKN7S6q2Gydx4 lEpB1ALvF9O5UcQub0M4WzhcCy2phLjffs4MveFrW4N2ubhRgL6TBclTKEV9A2xrK0qP eCbs/g26tyM/MW9x/gzk2MwNk99nwvL5QgB3TX4dH36ofBD2tkRpsgvqQK9coW9Il2j0 Yj5Q== X-Gm-Message-State: AOAM533cdD06a/oHaJaV8HZRS7q11oP46dqkYsKui/TqG/uJzJcVIG8j Btt3W6opU/pVgxrgfrvmGUIQrC4+m8iFq4Lr3ARvTQmFCaWDHGi9fmjaRu3NoMoEZa92JtGP6eY OXY327cPxokoPYGr4FYGQFvnuj4g0DInADiI= X-Received: by 2002:a05:600c:218c:: with SMTP id e12mr10837508wme.16.1621425805112; 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> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210519_050330_734224_3C95041F X-CRM114-Status: GOOD ( 24.94 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 19.05.21 13:45, Anshuman Khandual wrote: > > > 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); > > 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, all huge pages either have been migrated away or dissolved; the vmemmap is stable. vmemmap access (accessing the memmap via a virtual address) itself is not an issue. Manually walking (vmemmap) page tables might behave differently, not sure if ptdump would require any synchronization. > > 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. -- Thanks, David / dhildenb _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel