Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp206655iog; Wed, 29 Jun 2022 22:11:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uJ1BdigISEvoUHWI2caKy79Elmq4hIG6kwRn/pbqSTZQulwl679Muuqh7jR1EmPeaMsIKL X-Received: by 2002:a17:90a:8413:b0:1ea:ebf4:7079 with SMTP id j19-20020a17090a841300b001eaebf47079mr8377222pjn.48.1656565898044; Wed, 29 Jun 2022 22:11:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656565898; cv=none; d=google.com; s=arc-20160816; b=J9h+9BzXrCB1mGPPt1Qe3He9Ewk6q5tik9AhCsrazxYwof+iCAnLBwW/lOqOqJxi6G lN813JRbF3zMZnKT5f2m7cFiahG3ujFM6lKKKEtFhsu8ow4cDWECd9XOk1zYSaMgMRel SD5/TTMjbws8WsJLYdebYT5WzJdL+NLjd6MlHRz36hmEWq7UOavrY2Jnk91+OMWP6O2O eXiyqrTgWLNe4kPJvanQpbi1uJWgcrXqdw7/ksU5Arb1HzCpBV3yDFhnQk8K187me4ao aie1eMQZXv0+c2Yi8RwpOJxm5jBMESjMtwHuw9dNjYUG9PvhKg0ErRk4XpU55PlGCKsA LeYw== 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=+ydUyVFi6/8Bhs9/8RzUY5k7ozmCDK1a7CkjIzm+Bn4=; b=ndzdTzt4ZpTcqEox/MgMTt82IqiqAr9piP5bKatwjjC5diEpURe+UxJ/we+pbEvu3D jmu5bHF6qtiwpPS54PUtIFi+YaBK2Dn8BCmFHu8+tFidT9rLCFEPrtg9qnrt23tpxf/4 SywdyxyFHmr4Onn9c2Z9PwAoE2+KlmXvBFdL/JGVhuoqUWfqT2X7lglqVU7vESiQuJgq Mxl5RLWg/iyZuQ4Ayl8N3fEJ6MscjLWUHA1eOspRYg0Gczb2LMhSwZ0MnWmoTo8WbkpQ 80EycQ0uSXs5LYVngvyGfOjlO4dA5aCEsdJJpKoIxPCNHKhxgqFa7dgOJuslTSrPR+4B QhBQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o7-20020a635a07000000b0040d66be922dsi2999235pgb.16.2022.06.29.22.11.09; Wed, 29 Jun 2022 22:11:38 -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 S231620AbiF3Ebl (ORCPT + 99 others); Thu, 30 Jun 2022 00:31:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229687AbiF3Ebk (ORCPT ); Thu, 30 Jun 2022 00:31:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5464937AB0; Wed, 29 Jun 2022 21:31:38 -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 04C7BB8288B; Thu, 30 Jun 2022 04:31:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2FEFC34115; Thu, 30 Jun 2022 04:31:30 +0000 (UTC) From: Huacai Chen To: Arnd Bergmann , Huacai Chen , Thomas Bogendoerfer , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Catalin Marinas , Will Deacon 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, Huacai Chen , Feiyang Chen Subject: [PATCH V2 0/4] mm/sparse-vmemmap: Generalise helpers and enable for Date: Thu, 30 Jun 2022 12:32:33 +0800 Message-Id: <20220630043237.2059576-1-chenhuacai@loongson.cn> X-Mailer: git-send-email 2.27.0 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, T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org 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. Huacai Chen and Feiyang Chen(4): MIPS&LoongArch: 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 Signed-off-by: Feiyang Chen --- 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