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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08571C433F5 for ; Thu, 31 Mar 2022 08:42:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233166AbiCaIoF (ORCPT ); Thu, 31 Mar 2022 04:44:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232590AbiCaIoD (ORCPT ); Thu, 31 Mar 2022 04:44:03 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 60AEE1F1249 for ; Thu, 31 Mar 2022 01:42:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648716136; 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=8O7P4V32LmLKx1/fyryDQWDDIa4z/qPMVAMMY5dYyBQ=; b=fwSAFIkwTjUptP6NbC637pJcQbm8Pm8RR+QW6Woo0zvn5LOsB8zJ58RvomqWYR0fvDdL7b VTu0wvvRKDN+zHxvipl/XlQ0e1ke5izDtdytBZ5RmR5aMrap6P+AkgZ54HsFvAbJCx+eaw GdRdzUd4OQQb7z8orrM/bvoqmYNQNvo= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-175-E2eYrzdiOXCxIATNAhTjQw-1; Thu, 31 Mar 2022 04:42:15 -0400 X-MC-Unique: E2eYrzdiOXCxIATNAhTjQw-1 Received: by mail-wr1-f70.google.com with SMTP id i64-20020adf90c6000000b00203f2b5e090so6279786wri.9 for ; Thu, 31 Mar 2022 01:42:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=8O7P4V32LmLKx1/fyryDQWDDIa4z/qPMVAMMY5dYyBQ=; b=E/9rsJ2wyjhrh1I22qqmqa2jluyxjv4lrBpjVOFOxLgiRmpiZFxiQI7LNPOVO4yvKk jTnozjxefcZTF+g1Vy3BSu9no7nqKZdG7VsQxXAHypGEO4GnS8h4pattKS97HQlWOR6u UYBZED0f8vlxQzgsZGxgrt2pNWgLtKvJmwKK/fVzNav+sazShuBhquYfH3q9l0/APAhC cx2xgRqt/M/kjtQ7EZnGdSMwYKinz4TqNv7LvZNXt1a5nSpbVvfwiz13D8Wp33t0E9hc nJKttIMNg07w4ttqIu6scCLRt1cWHRyW7D8JZGdG/CWBC6Kvu/jb61uHc8zM6b5iS0k6 5rPw== X-Gm-Message-State: AOAM532w3tzE/rAWmG8bwfh/UUwV0vCZ7HTZi2o0f+xgEtYzjbqMctYk 1JaOqPNxJBis4bw/W/ShBAUogD84eZYPcf3TFJN5udPgBDnK9KP3j8iJwP0PvEqU3wU2m2IAA/S /erdCi1Xw/GdtIaIg449LHrwO X-Received: by 2002:adf:ef50:0:b0:204:3be:aaa0 with SMTP id c16-20020adfef50000000b0020403beaaa0mr3308615wrp.632.1648716133769; Thu, 31 Mar 2022 01:42:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzjvWfhy26tdh9LbPeR/3J64W85TY6O95IiKd5tQtgVqbXVualxL5wjcfLbfWcZcWN0wgW5Q== X-Received: by 2002:adf:ef50:0:b0:204:3be:aaa0 with SMTP id c16-20020adfef50000000b0020403beaaa0mr3308583wrp.632.1648716133302; Thu, 31 Mar 2022 01:42:13 -0700 (PDT) Received: from ?IPV6:2003:cb:c707:ac00:381c:2e8b:3b48:488e? (p200300cbc707ac00381c2e8b3b48488e.dip0.t-ipconnect.de. [2003:cb:c707:ac00:381c:2e8b:3b48:488e]) by smtp.gmail.com with ESMTPSA id u11-20020a056000038b00b00203e5c9aa09sm28212335wrf.27.2022.03.31.01.42.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 31 Mar 2022 01:42:12 -0700 (PDT) Message-ID: <6c774e27-26d2-6c45-65f9-8a5b8acd6433@redhat.com> Date: Thu, 31 Mar 2022 10:42:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH v4 1/2] mm: hugetlb_vmemmap: introduce ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP Content-Language: en-US To: Muchun Song , will@kernel.org, akpm@linux-foundation.org, bodeddub@amazon.com, osalvador@suse.de, mike.kravetz@oracle.com, rientjes@google.com, mark.rutland@arm.com, catalin.marinas@arm.com, james.morse@arm.com, 21cnbao@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com References: <20220331065640.5777-1-songmuchun@bytedance.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20220331065640.5777-1-songmuchun@bytedance.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 31.03.22 08:56, Muchun Song wrote: > The feature of minimizing overhead of struct page associated with each > HugeTLB page is implemented on x86_64, however, the infrastructure of > this feature is already there, we could easily enable it for other > architectures. Introduce ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP for other > architectures to be easily enabled. Just select this config if they > want to enable this feature. > > Suggested-by: Andrew Morton > Signed-off-by: Muchun Song > --- > arch/x86/Kconfig | 1 + > fs/Kconfig | 10 +++++++++- > 2 files changed, 10 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index 9f5bd41bf660..e69d42528542 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -119,6 +119,7 @@ config X86 > select ARCH_WANTS_DYNAMIC_TASK_STRUCT > select ARCH_WANTS_NO_INSTR > select ARCH_WANT_HUGE_PMD_SHARE > + select ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP if X86_64 > select ARCH_WANT_LD_ORPHAN_WARN > select ARCH_WANTS_THP_SWAP if X86_64 > select ARCH_HAS_PARANOID_L1D_FLUSH > diff --git a/fs/Kconfig b/fs/Kconfig > index 6c7dc1387beb..f6db2af33738 100644 > --- a/fs/Kconfig > +++ b/fs/Kconfig > @@ -245,9 +245,17 @@ config HUGETLBFS > config HUGETLB_PAGE > def_bool HUGETLBFS > > +# > +# Select this config option from the architecture Kconfig, if it is preferred > +# to enable the feature of minimizing overhead of struct page associated with > +# each HugeTLB page. > +# > +config ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP > + bool > + > config HUGETLB_PAGE_FREE_VMEMMAP > def_bool HUGETLB_PAGE > - depends on X86_64 > + depends on ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP > depends on SPARSEMEM_VMEMMAP > > config HUGETLB_PAGE_FREE_VMEMMAP_DEFAULT_ON I think something like "HUGETLB_OPTIMIZE_VMEMMAP" might be more expressive, but that would imply renaming the existing config knob. Apart from that LGTM. -- Thanks, David / dhildenb 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 413B3C433EF for ; Thu, 31 Mar 2022 08:43:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Dk5Fuonu4mlM1bNCyNzNnbu2zgbPCdx/kUInfCBK+U4=; b=mmIqPmw9F9ipG/ DWPqMuU/Z/bJHrGCgrwiUN5eMogcrA7WlUtpEctflxpsUsOmUc4geAIriO+va/1tECkTb5LUlySJr l6EL+u4WgE933B4lFH68NwOYq6wM/zIhW7p6LACd5nFKF8gpevYI5QQi5ynRArII/uF1bGOd4Q4OJ 2Oga++5RAyp30Aor0o1j0eyNs13n0xluj+3LMd2q1u9q3Aw5Pae6cookwUsjVr/3ZNKOqP4omBRA/ zX81VTWMNZG9PBAOp/ed/+nOsViNWtos1CnY0Wn/hzvJBrlaF4eP/xVu0BY6OJJhwqJRVXxpmUhum bOb7K7JjMK4H71igsQ7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nZqNs-001KEi-SG; Thu, 31 Mar 2022 08:42:25 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nZqNo-001KC4-2Y for linux-arm-kernel@lists.infradead.org; Thu, 31 Mar 2022 08:42:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648716136; 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=8O7P4V32LmLKx1/fyryDQWDDIa4z/qPMVAMMY5dYyBQ=; b=fwSAFIkwTjUptP6NbC637pJcQbm8Pm8RR+QW6Woo0zvn5LOsB8zJ58RvomqWYR0fvDdL7b VTu0wvvRKDN+zHxvipl/XlQ0e1ke5izDtdytBZ5RmR5aMrap6P+AkgZ54HsFvAbJCx+eaw GdRdzUd4OQQb7z8orrM/bvoqmYNQNvo= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-404-2iSRXBe_NJ-yVQfAS9zFpQ-1; Thu, 31 Mar 2022 04:42:15 -0400 X-MC-Unique: 2iSRXBe_NJ-yVQfAS9zFpQ-1 Received: by mail-wm1-f70.google.com with SMTP id v62-20020a1cac41000000b0038cfe6edf3fso1119930wme.5 for ; Thu, 31 Mar 2022 01:42:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=8O7P4V32LmLKx1/fyryDQWDDIa4z/qPMVAMMY5dYyBQ=; b=PjSZ3E7W4+qQ8IAHmhuDW5OJHb4NeWBWGQEh69Ert1MLM+viynWkNbbkOBIjYNybS6 +L00mkxS9jaei9fIWhR0LDrowlq9ZdL7tIDiTaV4VgVi3+Nc1TnhHNwsUKXW5Mq8esVa uLaC4ECBRF+bxJ1sutyIAIy1kY+zsZaVoMQI8gTqmBjrTBX1TzPu1w2EBxgiTQbsx2Xp YFkZwohJIjcfeyE36g9ENfuT2/b9S/+K2p8Lj4CUeWNiJLqAXP+6J+OLv2EUDaACg0N1 Wf14PlGHv0OzUoxMmBGKscyQvMe006R+YTdAsHRn2Xt7fDLsjgXfR5OsX4mVdCrPsGi1 0/RQ== X-Gm-Message-State: AOAM530Fs2dHBWri272FJlE0bbd4vUXot66p7SYnN5Q3Ds9zYhVvPr1z E9YlwIH5f31aPDweGmaZkqAo3v8L83/KHPGHCSHUtSM/XTJGK9XiWC5pjL7Fk9A0RZTUGkawSbG kmhDP+tOF7m9SugcpfMMFZ3rLuMPJ3o2JGik= X-Received: by 2002:adf:ef50:0:b0:204:3be:aaa0 with SMTP id c16-20020adfef50000000b0020403beaaa0mr3308618wrp.632.1648716133769; Thu, 31 Mar 2022 01:42:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzjvWfhy26tdh9LbPeR/3J64W85TY6O95IiKd5tQtgVqbXVualxL5wjcfLbfWcZcWN0wgW5Q== X-Received: by 2002:adf:ef50:0:b0:204:3be:aaa0 with SMTP id c16-20020adfef50000000b0020403beaaa0mr3308583wrp.632.1648716133302; Thu, 31 Mar 2022 01:42:13 -0700 (PDT) Received: from ?IPV6:2003:cb:c707:ac00:381c:2e8b:3b48:488e? (p200300cbc707ac00381c2e8b3b48488e.dip0.t-ipconnect.de. [2003:cb:c707:ac00:381c:2e8b:3b48:488e]) by smtp.gmail.com with ESMTPSA id u11-20020a056000038b00b00203e5c9aa09sm28212335wrf.27.2022.03.31.01.42.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 31 Mar 2022 01:42:12 -0700 (PDT) Message-ID: <6c774e27-26d2-6c45-65f9-8a5b8acd6433@redhat.com> Date: Thu, 31 Mar 2022 10:42:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH v4 1/2] mm: hugetlb_vmemmap: introduce ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP To: Muchun Song , will@kernel.org, akpm@linux-foundation.org, bodeddub@amazon.com, osalvador@suse.de, mike.kravetz@oracle.com, rientjes@google.com, mark.rutland@arm.com, catalin.marinas@arm.com, james.morse@arm.com, 21cnbao@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com References: <20220331065640.5777-1-songmuchun@bytedance.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20220331065640.5777-1-songmuchun@bytedance.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-20220331_014220_223621_4A4896E9 X-CRM114-Status: GOOD ( 21.67 ) 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 31.03.22 08:56, Muchun Song wrote: > The feature of minimizing overhead of struct page associated with each > HugeTLB page is implemented on x86_64, however, the infrastructure of > this feature is already there, we could easily enable it for other > architectures. Introduce ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP for other > architectures to be easily enabled. Just select this config if they > want to enable this feature. > > Suggested-by: Andrew Morton > Signed-off-by: Muchun Song > --- > arch/x86/Kconfig | 1 + > fs/Kconfig | 10 +++++++++- > 2 files changed, 10 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index 9f5bd41bf660..e69d42528542 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -119,6 +119,7 @@ config X86 > select ARCH_WANTS_DYNAMIC_TASK_STRUCT > select ARCH_WANTS_NO_INSTR > select ARCH_WANT_HUGE_PMD_SHARE > + select ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP if X86_64 > select ARCH_WANT_LD_ORPHAN_WARN > select ARCH_WANTS_THP_SWAP if X86_64 > select ARCH_HAS_PARANOID_L1D_FLUSH > diff --git a/fs/Kconfig b/fs/Kconfig > index 6c7dc1387beb..f6db2af33738 100644 > --- a/fs/Kconfig > +++ b/fs/Kconfig > @@ -245,9 +245,17 @@ config HUGETLBFS > config HUGETLB_PAGE > def_bool HUGETLBFS > > +# > +# Select this config option from the architecture Kconfig, if it is preferred > +# to enable the feature of minimizing overhead of struct page associated with > +# each HugeTLB page. > +# > +config ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP > + bool > + > config HUGETLB_PAGE_FREE_VMEMMAP > def_bool HUGETLB_PAGE > - depends on X86_64 > + depends on ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP > depends on SPARSEMEM_VMEMMAP > > config HUGETLB_PAGE_FREE_VMEMMAP_DEFAULT_ON I think something like "HUGETLB_OPTIMIZE_VMEMMAP" might be more expressive, but that would imply renaming the existing config knob. Apart from that LGTM. -- Thanks, David / dhildenb _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel