Received: by 2002:ac0:cd04:0:0:0:0:0 with SMTP id w4csp603729imn; Sat, 2 Jul 2022 01:50:20 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tbGvkA1WlxgCh5JgeAB2QoMq4krJ5Ged5tTRXUIEr0MhWU+MRB60jcq7V+JnGErBJsfYJt X-Received: by 2002:a17:907:628c:b0:6ee:70cf:d59 with SMTP id nd12-20020a170907628c00b006ee70cf0d59mr18292179ejc.402.1656751820606; Sat, 02 Jul 2022 01:50:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656751820; cv=none; d=google.com; s=arc-20160816; b=eS4aS20jZM0Aj574hjb7ZDvg3Wqx8gWqFUHf6R3dlQdcE5ZBWPL9OERk8cox6GLXwC crse637d9gLL6B/rAqVz15wnhKq6RozQwR9fC5sDf8Nbfo14cQpjarm+qP9Sad7bZCwn crRfMG3MVMNBPtcsUU6tDJUc8hqnwrTJ46UMLemECXdX53ytqu8FnrgLmS28SjZX21Y4 pQ1d0MbjmhOt2zeZ72jhUzDi7i6cagLjwJsazc6KpP/eJHFbOX3gbH9K7b/WDojNqcRY N5kCKFmi4WlassH7LNNWcSTbvwiDUOaw6naMcn7mp1CLZi0/tiIcWrWYmd8lbI29/6p7 X0Bg== 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=OxToKVODoWr62n9Qv29rcnHltFoIGJBArJ56j9JVrWw=; b=d3aJms9kDpBOmtL9LVaUz6Jhd0smiuRENCRuZ3RDZpUSC1v3SaDEBf72M1lpxRPuDt xz9lgcKIvwYw3BMPFE3jY69YivkLqZNc6mLYmJ5qQzHsIn8hP9FsnOsn6LPdWyo1qvTL snGqy9uMYykdDvOzbjra9ZcSjj5Zbth9QKPveDt0/jd88PBhr/eBBGDCxFxj7IY26aZ/ YDH6q66doYe3SxpejJuTBG3t9LjGLbfTOuXlQ5SYpQdlvMfXlSbl8biUaT/xsfnnW12p pNbHCn2HA7iGxRHaMlYLU68euC+WNWnWuimyTZ59moNlUByUu/nll9HTrwteJBilv4dF O5eA== 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 du20-20020a17090772d400b0072a6be70d30si8385074ejc.385.2022.07.02.01.49.55; Sat, 02 Jul 2022 01:50:20 -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 S229934AbiGBH7V (ORCPT + 99 others); Sat, 2 Jul 2022 03:59:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230183AbiGBH7U (ORCPT ); Sat, 2 Jul 2022 03:59:20 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 825331AF33; Sat, 2 Jul 2022 00:59:19 -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 sin.source.kernel.org (Postfix) with ESMTPS id A50EECE08CB; Sat, 2 Jul 2022 07:59:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F483C34114; Sat, 2 Jul 2022 07:59:11 +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 V3 0/4] mm/sparse-vmemmap: Generalise helpers and enable for LoongArch Date: Sat, 2 Jul 2022 16:00:17 +0800 Message-Id: <20220702080021.1167190-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. V2 -> V3: 1, Change the Signed-off-by order of author and committer; 2, Update commit message about the build error on LoongArch. 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