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 A7765C4332F for ; Fri, 21 Oct 2022 14:08:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 45B198E0002; Fri, 21 Oct 2022 10:08:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 40B948E0001; Fri, 21 Oct 2022 10:08:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2D2D68E0002; Fri, 21 Oct 2022 10:08:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 1B5F18E0001 for ; Fri, 21 Oct 2022 10:08:47 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id DE331A04B9 for ; Fri, 21 Oct 2022 14:08:46 +0000 (UTC) X-FDA: 80045137452.27.3063A76 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf04.hostedemail.com (Postfix) with ESMTP id 54CB74003A for ; Fri, 21 Oct 2022 14:08:45 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6CAE161EC1 for ; Fri, 21 Oct 2022 14:08:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D425C43144 for ; Fri, 21 Oct 2022 14:08:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666361323; bh=Xo9JwJY/XMU3fy2R/321Jyhdz5lA7kxLyPv0VQaYCmg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Wwaa/+fZi02vh1Dn21QNaUJd4JP907px6Nm2UnMwpekf2npzFOwFvhPioALc1UONJ 8ofPTUVMkQw1G3VveiPd76Sos1nwVY2/heVdF4oWu/3qV/74un5rqmkowQV31T7UQw t7ZNkB5TYOYj7abhCh2mSD7ofTrM63eidIF0dcEFUbCSKTFEfV23jErCMz0lyDrXtN Pq8LYbHWAwUzAEd7hdrnsobs3zH6s5vlf62R8Rsl7pR/SBDWUOd9X2KrvYay9ZZVwI N0MUMXqs3GsFnFvE/N8tXfXWWOuc1msGmZOhYsyr2bMyxB0ssBXFGLlxFhLJndP1Vo b1rQ4qAJLUjbg== Received: by mail-ed1-f47.google.com with SMTP id r14so6283466edc.7 for ; Fri, 21 Oct 2022 07:08:42 -0700 (PDT) X-Gm-Message-State: ACrzQf2vwsilNkcbyPki6e/gt+1UMej/xLYNPu1/NXmTVqueZdfKf4vo vdpKuwYt3yrlphlhB2G+K+urv7tnuMsVuIZbR18= X-Google-Smtp-Source: AMsMyM56nUz8sGkCeqBVJoK6oDcAc8hZNHP1QjobCqaJwAuRDswWz3ulV0+QMeIS7x6P23jddz9EQQp/xYKEHom6WFA= X-Received: by 2002:aa7:d4d9:0:b0:45c:7eae:d8d8 with SMTP id t25-20020aa7d4d9000000b0045c7eaed8d8mr17594307edr.254.1666361321203; Fri, 21 Oct 2022 07:08:41 -0700 (PDT) MIME-Version: 1.0 References: <20221020072317.492906-1-chenhuacai@loongson.cn> <20221020072317.492906-5-chenhuacai@loongson.cn> <1ca11693-17c2-7260-b642-70b033c64b30@linaro.org> In-Reply-To: <1ca11693-17c2-7260-b642-70b033c64b30@linaro.org> From: Huacai Chen Date: Fri, 21 Oct 2022 22:08:28 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V12 4/4] LoongArch: Enable ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP To: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= Cc: Huacai Chen , Arnd Bergmann , Thomas Bogendoerfer , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Catalin Marinas , Will Deacon , Dinh Nguyen , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666361325; a=rsa-sha256; cv=none; b=ebPXYCAKCIvksMgHrOwlUCvobOzdbbKKAmTuA4TtEgdNOOQl5lMoBHpHKUj23TG1iyDgmO p4JER15ZwR4zuT8kk/aCjK5cX/PTssZJDAYjaJC4X5DMPDQ1ZZlNe0bbB2G1WINAMh8klG PdqGgM9l/TJToMJKj6xRAGwNCt9/zvA= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="Wwaa/+fZ"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf04.hostedemail.com: domain of chenhuacai@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=chenhuacai@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666361325; 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=eMVixoJBh7Wh8O7B/IoudzH8rA1xDI6vWD5DRZKC6CI=; b=qIpyzulJIztR+DI0Bzeqjm17b+ZHWOH+IXyPvS4WYf5Q2QeNXp2wbSvc+u36QdPYH9tjUE VYVK5glYyswCXEmc0a8+hbnuGoorql/AaJygOT4JRTyXTV5yqH/73+6OpKP3PfJWPQDqbF h2l/o9Y4UnGOE6yaxb1/uXwrbpexdSk= Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="Wwaa/+fZ"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf04.hostedemail.com: domain of chenhuacai@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=chenhuacai@kernel.org X-Rspamd-Server: rspam04 X-Rspam-User: X-Stat-Signature: 39y775xro6upxprqni9hne7c8dcgawzg X-Rspamd-Queue-Id: 54CB74003A X-HE-Tag: 1666361325-703942 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: Hi, Philippe, On Fri, Oct 21, 2022 at 6:16 PM Philippe Mathieu-Daud=C3=A9 wrote: > > 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/ Thanks, I will change it. > > > 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. The static_key.h inclusion is also LoongArch-specific, implicitly. X86 and ARM64 have no build errors without this inclusion, because they include static_key.h from their arch-specific core headers. Once before I have sent a separate patch to "fix missing include", but Greg said that "don't fix unless you have a real problem". :) Huacai > > 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_DEF= AULT_ON, > > | ^~~~~~~~~~~~~~~~~~~~~~~~ > > ./include/linux/page-flags.h:208:1: error: type defaults to 'int' in > > declaration of 'DECLARE_STATIC_KEY_MAYBE' [-Werror=3Dimplicit-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_ena= bled': > > ./include/linux/page-flags.h:213:16: error: implicit declaration of > > function 'static_branch_maybe' [-Werror=3Dimplicit-function-declaration= ] > > 213 | return static_branch_maybe(CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_D= EFAULT_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_D= EFAULT_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=C3=A9 > >