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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98EB1C4332F for ; Fri, 21 Oct 2022 10:16:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3AA708E0006; Fri, 21 Oct 2022 06:16:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 35B908E0001; Fri, 21 Oct 2022 06:16:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 222928E0006; Fri, 21 Oct 2022 06:16:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 0F6F18E0001 for ; Fri, 21 Oct 2022 06:16:56 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id DE4DDA5BA0 for ; Fri, 21 Oct 2022 10:16:55 +0000 (UTC) X-FDA: 80044553190.05.316C6C8 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by imf26.hostedemail.com (Postfix) with ESMTP id 6609114000A for ; Fri, 21 Oct 2022 10:16:55 +0000 (UTC) Received: by mail-wm1-f54.google.com with SMTP id fn7-20020a05600c688700b003b4fb113b86so1699901wmb.0 for ; Fri, 21 Oct 2022 03:16:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=+5cnDmrVndRxKiTHUVemxonBJmpJGHILsZC3ogF/MOw=; b=JPtq+/IRujntwIE/R0H50vcNFzBxZsG6vivxycGAXnEB2uRQt6ffZwiejqzB7e2thQ NUlcGdmwHolJLIyBZw0eVbnviS2rST1avPMOUkg8ACV8YerSEMWgInAYBS94wGapJw4i bfRlNjVOU9KrSi7RqliTvkKJa7cZtLfpxfwmxtE2ad1zmQef69xoS1eIddjy6V/CVYIV OSX1sAbFVNxDQkT8WjHl639ubVOThBYSN7UldhIlgneUKM+K/ZRScAH6fxsbB5g0MWT/ 301O4bxqIRd29ca4wje7C/60v3tVfhwf0S5eO9cBOGxlGkTMgxAyQO3qnOla5YK5a34j LIJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+5cnDmrVndRxKiTHUVemxonBJmpJGHILsZC3ogF/MOw=; b=e/hQFRQB2MAMY0PJ58zWKIQJRwmSZSZIbz/bJrBd41cuGfwKaOJ7Cy6+c4wkt4H68l 2KhP0hkEiz5HD2gbM/+NObpOrqlAcpXxIZo0zw4vXHIvBUYfLe4jkicIt4y8I3AavUY9 8tf5C/1id21j2VaYUEi/1eYiiP4u78kG6G+KV758yQGI4tpBYAAzIqXJNqo4vifvqYIS rsVeUJY2omjQFlS3jsRLY7xlK0DL9dfuo7IKRIFOiKtdan4fcwDvQUeKE2CIkRyhknhr eNrNglvlVKw4RYFi02Cjy5CEgFcJi78uEWMXmyi+0AFEUM7Cq53eOKoKhRGn5dTjDK32 CmXQ== X-Gm-Message-State: ACrzQf1DiYLuaEMNaOt5JrCaRfOK/AmFuysSijdlLqCy0golEI0i7zo2 dF9ItgsM/FGhRixD9T6A0ajHJXNNjqH+CA== X-Google-Smtp-Source: AMsMyM7lFiRw/3BBe90FzLXlb+jXp4Bsd46molv2+M4Io/03D653ZKfrdrAMjZSj/Yk+qHqfl4wzbA== X-Received: by 2002:a7b:c841:0:b0:3c6:ce2f:3438 with SMTP id c1-20020a7bc841000000b003c6ce2f3438mr12545988wml.51.1666347414085; Fri, 21 Oct 2022 03:16:54 -0700 (PDT) Received: from [10.50.0.10] (ec2-54-194-108-71.eu-west-1.compute.amazonaws.com. [54.194.108.71]) by smtp.gmail.com with ESMTPSA id ay41-20020a05600c1e2900b003c6f0ebf988sm2166623wmb.30.2022.10.21.03.16.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Oct 2022 03:16:53 -0700 (PDT) Message-ID: <1ca11693-17c2-7260-b642-70b033c64b30@linaro.org> Date: Fri, 21 Oct 2022 12:16:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Subject: Re: [PATCH V12 4/4] LoongArch: Enable ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP Content-Language: en-US To: Huacai Chen , Arnd Bergmann , Huacai Chen , Thomas Bogendoerfer , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Catalin Marinas , Will Deacon , Dinh Nguyen Cc: loongarch@lists.linux.dev, linux-arch@vger.kernel.org, Xuefeng Li , Guo Ren , Xuerui Wang , Jiaxun Yang , Andrew Morton , linux-mm@kvack.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Feiyang Chen References: <20221020072317.492906-1-chenhuacai@loongson.cn> <20221020072317.492906-5-chenhuacai@loongson.cn> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= In-Reply-To: <20221020072317.492906-5-chenhuacai@loongson.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b="JPtq+/IR"; spf=pass (imf26.hostedemail.com: domain of philmd@linaro.org designates 209.85.128.54 as permitted sender) smtp.mailfrom=philmd@linaro.org; dmarc=pass (policy=none) header.from=linaro.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666347415; a=rsa-sha256; cv=none; b=cvu9MMIvfSagoA2QSOGTpbqQAGG0uO7SaEwjtN0bOpzCx4K5SYY++BQ/lN0Fek8UPF2hmr smjrbmGfef1dQ/ObUrmfvX0+bc98fA08ir5TSdUnkKqNYvalUfSrf9lkObBlkO+5YYBuVX kP4FLe/4C0dYF1eZqRcY4VX9qpVo1YY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666347415; h=from:from:sender: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:dkim-signature; bh=+5cnDmrVndRxKiTHUVemxonBJmpJGHILsZC3ogF/MOw=; b=BCpHGpNcErMsNsEo2EEQmwyYQ7SkKShW5OhRcML7tHnYGwkPAaRq5EA78f+0I57XVEm28q zVYbQpqtRD3P/Sq7tAWEhktZjgEfeoioWJyVQqdyirUddRA6ALNlUQ65+oNJJP2T5Y0NXm TuoXDGe8tGgDRNAIL5qrqMZlAG3jGb8= Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b="JPtq+/IR"; spf=pass (imf26.hostedemail.com: domain of philmd@linaro.org designates 209.85.128.54 as permitted sender) smtp.mailfrom=philmd@linaro.org; dmarc=pass (policy=none) header.from=linaro.org X-Stat-Signature: gjgy781fbcjenk4kfhhtmjtuccqfc57y X-Rspamd-Queue-Id: 6609114000A X-Rspamd-Server: rspam02 X-Rspam-User: X-HE-Tag: 1666347415-423675 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 20/10/22 09:23, Huacai Chen wrote: > From: Feiyang Chen > > 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, so just select ARCH_WANT_HUGETLB_PAGE_ > OPTIMIZE_VMEMMAP is enough to enable this feature for LoongArch. > > To avoid the following build error on LoongArch we should include linux/ s/should/have to/ > static_key.h in page-flags.h. This looks like 2 different changes in a single patch.. The first is a generic "fix missing include" and the second is LoongArch specific. Splitting in 2 would ease backport cherry-picks. > In file included from ./include/linux/mmzone.h:22, > from ./include/linux/gfp.h:6, > from ./include/linux/mm.h:7, > from arch/loongarch/kernel/asm-offsets.c:9: > ./include/linux/page-flags.h:208:1: warning: data definition has no > type or storage class > 208 | DECLARE_STATIC_KEY_MAYBE(CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON, > | ^~~~~~~~~~~~~~~~~~~~~~~~ > ./include/linux/page-flags.h:208:1: error: type defaults to 'int' in > declaration of 'DECLARE_STATIC_KEY_MAYBE' [-Werror=implicit-int] > ./include/linux/page-flags.h:209:26: warning: parameter names (without > types) in function declaration > 209 | hugetlb_optimize_vmemmap_key); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ./include/linux/page-flags.h: In function 'hugetlb_optimize_vmemmap_enabled': > ./include/linux/page-flags.h:213:16: error: implicit declaration of > function 'static_branch_maybe' [-Werror=implicit-function-declaration] > 213 | return static_branch_maybe(CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON, > | ^~~~~~~~~~~~~~~~~~~ > ./include/linux/page-flags.h:213:36: error: > 'CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON' undeclared (first > use in this function); did you mean > 'CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP'? > 213 | return static_branch_maybe(CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > | CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP > ./include/linux/page-flags.h:213:36: note: each undeclared identifier > is reported only once for each function it appears in > ./include/linux/page-flags.h:214:37: error: > 'hugetlb_optimize_vmemmap_key' undeclared (first use in this > function); did you mean 'hugetlb_optimize_vmemmap_enabled'? > 214 | &hugetlb_optimize_vmemmap_key); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ > | hugetlb_optimize_vmemmap_enabled > > Signed-off-by: Feiyang Chen > Signed-off-by: Huacai Chen > --- > arch/loongarch/Kconfig | 1 + > include/linux/page-flags.h | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig > index 6f7fa0c0ca08..0a6ef613124c 100644 > --- a/arch/loongarch/Kconfig > +++ b/arch/loongarch/Kconfig > @@ -52,6 +52,7 @@ config LOONGARCH > select ARCH_USE_QUEUED_RWLOCKS > select ARCH_USE_QUEUED_SPINLOCKS > select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT > + select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP > select ARCH_WANT_LD_ORPHAN_WARN > select ARCH_WANTS_NO_INSTR > select BUILDTIME_TABLE_SORT > diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h > index 0b0ae5084e60..1aafdc73e399 100644 > --- a/include/linux/page-flags.h > +++ b/include/linux/page-flags.h > @@ -9,6 +9,7 @@ > #include > #include > #include > +#include > #ifndef __GENERATING_BOUNDS_H > #include > #include Preferably splitting in 2 distinct patches (for each): Reviewed-by: Philippe Mathieu-Daudé