Message ID | 20221027125253.3458989-1-chenhuacai@loongson.cn |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp218767wru; Thu, 27 Oct 2022 06:06:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Vmb/vleliyjeQGZkKdoZobkN5WWIUP55miRJIh9IFdjz/5yWACmpxmnYj1ioGsHJPshwW X-Received: by 2002:a17:906:99c2:b0:7a8:c167:1d93 with SMTP id s2-20020a17090699c200b007a8c1671d93mr17592702ejn.490.1666875965272; Thu, 27 Oct 2022 06:06:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666875965; cv=none; d=google.com; s=arc-20160816; b=zvUTPBDMKdaXsR4+zXG+pCbCcD466JosqJ7E1bs+GN8do6pG2Xl04L1yaxV/y80fMo WMhew1mooF/j8P3BHR6nRO49K8I0HVX/Den5amqiAJJDTSGPpGBhl34Au5vNUOaG+O4b HWAL+cgaZ/+nlm3v4OYOSn7ZuZdEteulOUy54DVya/ZxiGtXuWDNpzrECRuL0l3D/7bs UkZ+Ve5LA1zFKlawWtVVlwye7UM1KZryl9jWkR2fGApPqcg1TFUbj/LI4eBjf/3vD/Za PXeY253oFPnTnX3JTmjzvv+Xi9q5Z6QfFOKtpc4KFfemC7dlPAJ2Iae7NUJeXduagjha HlZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=up5fjltPbNU+Zcn1niP8ukQgwSMBAASue3dt8YZ/TIw=; b=XL2R6wcMotfgK/fNULsZumWI5zwhnbWg6qIIDCM3jIfiDC/XAvlBVaYEdiA6TE12Hq cKrY9/Z0SBbamRrjdcyb42D8mmCrhI/9DwRz3z9PtOLkvhU5IPjgxA7J4pgVc8Vqh5zW 2HzqUHI6DLzG0Ecxwmn6h/NnfITmr+hiwKeCvWOKdT+pJlskeghxxJpgSaJZj4htoUSC ywh3Vr6l7weQeGOEkHV9QX6acBd3uX+sPMSgNvNSa3JCRIaqWnnc+EPLmOIbg3/O/8QI FPjUoysm4LmRZo7KNESdiIRjJn4fALgsZa9qkaA/6Vp3NrU2MddX4rBkScxLVnaMo1k7 TIjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h15-20020a1709063b4f00b007826cb6f57csi1263571ejf.407.2022.10.27.06.05.25; Thu, 27 Oct 2022 06:06:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235848AbiJ0MzD (ORCPT <rfc822;chrisfriedt@gmail.com> + 99 others); Thu, 27 Oct 2022 08:55:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235574AbiJ0MzB (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 27 Oct 2022 08:55:01 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B99672338B; Thu, 27 Oct 2022 05:54:57 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id 768BAB82631; Thu, 27 Oct 2022 12:54:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21BACC433B5; Thu, 27 Oct 2022 12:54:49 +0000 (UTC) From: Huacai Chen <chenhuacai@loongson.cn> To: Arnd Bergmann <arnd@arndb.de>, Huacai Chen <chenhuacai@kernel.org>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>, Dave Hansen <dave.hansen@linux.intel.com>, Andy Lutomirski <luto@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Dinh Nguyen <dinguyen@kernel.org> Cc: loongarch@lists.linux.dev, linux-arch@vger.kernel.org, Xuefeng Li <lixuefeng@loongson.cn>, Guo Ren <guoren@kernel.org>, Xuerui Wang <kernel@xen0n.name>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Huacai Chen <chenhuacai@loongson.cn>, Feiyang Chen <chenfeiyang@loongson.cn> Subject: [PATCH V14 0/4] mm/sparse-vmemmap: Generalise helpers and enable for LoongArch Date: Thu, 27 Oct 2022 20:52:49 +0800 Message-Id: <20221027125253.3458989-1-chenhuacai@loongson.cn> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747846132137196110?= X-GMAIL-MSGID: =?utf-8?q?1747846132137196110?= |
Series |
mm/sparse-vmemmap: Generalise helpers and enable for LoongArch
|
|
Message
Huacai Chen
Oct. 27, 2022, 12:52 p.m. UTC
This series is in order to enable sparse-vmemmap for LoongArch. But LoongArch cannot use generic helpers directly because MIPS&LoongArch need to call pgd_init()/pud_init()/pmd_init() when populating page tables. So we adjust the prototypes of p?d_init() to make generic helpers can call them, then enable sparse-vmemmap with generic helpers, and to be further, generalise vmemmap_populate_hugepages() for ARM64, X86 and LoongArch. V1 -> V2: Split ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP to a separate patch. V2 -> V3: 1, Change the Signed-off-by order of author and committer; 2, Update commit message about the build error on LoongArch. V3 -> V4: Change pmd to pmdp for ARM64 for consistency. V4 -> V5: Add a detailed comment for no-fallback in the altmap case. V5 -> V6: 1, Fix build error for NIOS2; 2, Fix build error for allnoconfig; 3, Update comment for no-fallback in the altmap case. V6 -> V7: Fix build warnings of "no previous prototype". V7 -> V8: Fix build error for MIPS pud_init(). V8 -> V9: Remove redundant #include to avoid build error with latest upstream kernel. V9 -> V10: Fix build error due to VMEMMAP changes in 6.0-rc1. V10 -> V11: Adjust context due to ARM64 changes in 6.1-rc1. V11 -> V12: 1, Fix build error for !SPARSEMEM; 2, Simplify pagetable_init() for MIPS32. V12 -> V13: 1, Add Acked-by and Reviewed-by tags; 2, Update commit message for the 4th patch. V13 -> V14: Remove the static_key.h inclusion in the 4th patch. Huacai Chen and Feiyang Chen(4): MIPS&LoongArch&NIOS2: Adjust prototypes of p?d_init(). LoongArch: Add sparse memory vmemmap support. mm/sparse-vmemmap: Generalise vmemmap_populate_hugepages(). LoongArch: Enable ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP. Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn> --- arch/arm64/mm/mmu.c | 53 ++++++-------------- arch/loongarch/Kconfig | 2 + arch/loongarch/include/asm/pgalloc.h | 13 +---- arch/loongarch/include/asm/pgtable.h | 13 +++-- arch/loongarch/include/asm/sparsemem.h | 8 +++ arch/loongarch/kernel/numa.c | 4 +- arch/loongarch/mm/init.c | 44 +++++++++++++++- arch/loongarch/mm/pgtable.c | 23 +++++---- arch/mips/include/asm/pgalloc.h | 8 +-- arch/mips/include/asm/pgtable-64.h | 8 +-- arch/mips/kvm/mmu.c | 3 +- arch/mips/mm/pgtable-32.c | 10 ++-- arch/mips/mm/pgtable-64.c | 18 ++++--- arch/mips/mm/pgtable.c | 2 +- arch/x86/mm/init_64.c | 92 ++++++++++++---------------------- include/linux/mm.h | 8 +++ include/linux/page-flags.h | 1 + mm/sparse-vmemmap.c | 64 +++++++++++++++++++++++ 18 files changed, 222 insertions(+), 152 deletions(-) -- 2.27.0
Comments
Hi, Arnd, Just a gentle ping, is this series good enough now? I think the last problem (static-key.h inclusion) has also been solved. Huacai On Thu, Oct 27, 2022 at 8:54 PM Huacai Chen <chenhuacai@loongson.cn> wrote: > > This series is in order to enable sparse-vmemmap for LoongArch. But > LoongArch cannot use generic helpers directly because MIPS&LoongArch > need to call pgd_init()/pud_init()/pmd_init() when populating page > tables. So we adjust the prototypes of p?d_init() to make generic > helpers can call them, then enable sparse-vmemmap with generic helpers, > and to be further, generalise vmemmap_populate_hugepages() for ARM64, > X86 and LoongArch. > > V1 -> V2: > Split ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP to a separate patch. > > V2 -> V3: > 1, Change the Signed-off-by order of author and committer; > 2, Update commit message about the build error on LoongArch. > > V3 -> V4: > Change pmd to pmdp for ARM64 for consistency. > > V4 -> V5: > Add a detailed comment for no-fallback in the altmap case. > > V5 -> V6: > 1, Fix build error for NIOS2; > 2, Fix build error for allnoconfig; > 3, Update comment for no-fallback in the altmap case. > > V6 -> V7: > Fix build warnings of "no previous prototype". > > V7 -> V8: > Fix build error for MIPS pud_init(). > > V8 -> V9: > Remove redundant #include to avoid build error with latest upstream > kernel. > > V9 -> V10: > Fix build error due to VMEMMAP changes in 6.0-rc1. > > V10 -> V11: > Adjust context due to ARM64 changes in 6.1-rc1. > > V11 -> V12: > 1, Fix build error for !SPARSEMEM; > 2, Simplify pagetable_init() for MIPS32. > > V12 -> V13: > 1, Add Acked-by and Reviewed-by tags; > 2, Update commit message for the 4th patch. > > V13 -> V14: > Remove the static_key.h inclusion in the 4th patch. > > Huacai Chen and Feiyang Chen(4): > MIPS&LoongArch&NIOS2: Adjust prototypes of p?d_init(). > LoongArch: Add sparse memory vmemmap support. > mm/sparse-vmemmap: Generalise vmemmap_populate_hugepages(). > LoongArch: Enable ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP. > > Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> > Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn> > --- > arch/arm64/mm/mmu.c | 53 ++++++-------------- > arch/loongarch/Kconfig | 2 + > arch/loongarch/include/asm/pgalloc.h | 13 +---- > arch/loongarch/include/asm/pgtable.h | 13 +++-- > arch/loongarch/include/asm/sparsemem.h | 8 +++ > arch/loongarch/kernel/numa.c | 4 +- > arch/loongarch/mm/init.c | 44 +++++++++++++++- > arch/loongarch/mm/pgtable.c | 23 +++++---- > arch/mips/include/asm/pgalloc.h | 8 +-- > arch/mips/include/asm/pgtable-64.h | 8 +-- > arch/mips/kvm/mmu.c | 3 +- > arch/mips/mm/pgtable-32.c | 10 ++-- > arch/mips/mm/pgtable-64.c | 18 ++++--- > arch/mips/mm/pgtable.c | 2 +- > arch/x86/mm/init_64.c | 92 ++++++++++++---------------------- > include/linux/mm.h | 8 +++ > include/linux/page-flags.h | 1 + > mm/sparse-vmemmap.c | 64 +++++++++++++++++++++++ > 18 files changed, 222 insertions(+), 152 deletions(-) > -- > 2.27.0 >
On Sat, Nov 12, 2022, at 11:26, Huacai Chen wrote: > Hi, Arnd, > > Just a gentle ping, is this series good enough now? I think the last > problem (static-key.h inclusion) has also been solved. Yes, this looks fine to me. Sorry I didn't have this on my radar any more. Reviewed-by: Arnd Bergmann <arnd@arndb.de> I guess the series should be merged through Andrew's linux-mm tree. Let me know if for some reason I should pick it up into the asm-generic tree instead. Arnd
Hi, Andrew, On Tue, Nov 15, 2022 at 4:09 AM Arnd Bergmann <arnd@arndb.de> wrote: > > On Sat, Nov 12, 2022, at 11:26, Huacai Chen wrote: > > Hi, Arnd, > > > > Just a gentle ping, is this series good enough now? I think the last > > problem (static-key.h inclusion) has also been solved. > > Yes, this looks fine to me. Sorry I didn't have this on my > radar any more. > > Reviewed-by: Arnd Bergmann <arnd@arndb.de> > > I guess the series should be merged through Andrew's linux-mm > tree. Let me know if for some reason I should pick it up into > the asm-generic tree instead. Another gentle ping, can this series be merged to linux-mm in the 6.2 cycle? Huacai > > Arnd
On Sun, 27 Nov 2022 13:01:19 +0800 Huacai Chen <chenhuacai@kernel.org> wrote: > Hi, Andrew, > > On Tue, Nov 15, 2022 at 4:09 AM Arnd Bergmann <arnd@arndb.de> wrote: > > > > On Sat, Nov 12, 2022, at 11:26, Huacai Chen wrote: > > > Hi, Arnd, > > > > > > Just a gentle ping, is this series good enough now? I think the last > > > problem (static-key.h inclusion) has also been solved. > > > > Yes, this looks fine to me. Sorry I didn't have this on my > > radar any more. > > > > Reviewed-by: Arnd Bergmann <arnd@arndb.de> > > > > I guess the series should be merged through Andrew's linux-mm > > tree. Let me know if for some reason I should pick it up into > > the asm-generic tree instead. > Another gentle ping, can this series be merged to linux-mm in the 6.2 cycle? It's a pretty large patchset and I'm a bit concerned about the amount of review and test which it has received from the MIPS side? Prudence suggest that we merge this in 6.3-rc1. But I'll queue it up for now, get a bit of testing while we consider this.
On Tue, Nov 29, 2022 at 7:10 AM Andrew Morton <akpm@linux-foundation.org> wrote: > > On Sun, 27 Nov 2022 13:01:19 +0800 Huacai Chen <chenhuacai@kernel.org> wrote: > > > Hi, Andrew, > > > > On Tue, Nov 15, 2022 at 4:09 AM Arnd Bergmann <arnd@arndb.de> wrote: > > > > > > On Sat, Nov 12, 2022, at 11:26, Huacai Chen wrote: > > > > Hi, Arnd, > > > > > > > > Just a gentle ping, is this series good enough now? I think the last > > > > problem (static-key.h inclusion) has also been solved. > > > > > > Yes, this looks fine to me. Sorry I didn't have this on my > > > radar any more. > > > > > > Reviewed-by: Arnd Bergmann <arnd@arndb.de> > > > > > > I guess the series should be merged through Andrew's linux-mm > > > tree. Let me know if for some reason I should pick it up into > > > the asm-generic tree instead. > > Another gentle ping, can this series be merged to linux-mm in the 6.2 cycle? > > It's a pretty large patchset and I'm a bit concerned about the amount > of review and test which it has received from the MIPS side? We have tested on MIPS-based Loongson. :) > > Prudence suggest that we merge this in 6.3-rc1. But I'll queue it up > for now, get a bit of testing while we consider this. > OK, thanks, you are free to decide this. Huacai