Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp255920iog; Wed, 29 Jun 2022 23:35:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1txEE33Ig00BpAaQQxNrYOFZJsV2WJV4Dp/PVNWekTsyP6C5ouP0vSJ6sT8q/LUL7DUsg/a X-Received: by 2002:a17:907:7e97:b0:718:f4d4:c970 with SMTP id qb23-20020a1709077e9700b00718f4d4c970mr7069926ejc.250.1656570911736; Wed, 29 Jun 2022 23:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656570911; cv=none; d=google.com; s=arc-20160816; b=jQesjLLK+UBEtvDu1LgNdE5uu12B1rcWS0UQI7xyUCfN8nECj9naO/d4aG8GmzG/bv 1HY8OcNitXwH5NKR6xL+HGZi449kTIRmIBCyIYb74lU+FGOIb/ms3yvlestAUPv2ADBm y26/+vvtZl4UBo+uOfGFn5TirMoye+gcRuVAX48Ja33s0lU0acJC9RhzxtML2aTLom+O wDlKvTqJmq4DHkZf7IVk+rejSWLlioVdQ0awkmoimyUL1fUqv4ea4OTiPawerhaWRwEs kzE3PXlEBFSW5UXkmdYPhTBvPmKB1B7llDhI0A6PJnDJhW3DTVrFVr8Ltw+/MYu/lD4H 80dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=Y07IJIY2PVG2W+KVUqwOvQgsNreP5AqI6a/EQhTQOkg=; b=Bu14nDXaYyOJ+X8Ej1nk2av/0wfTtpf+0vxPJ327KLiDbDdzsLdJ3iuY3NdVenZNtW cFKS6h7TumcxiYz2M6UVeMNaROEEwHO+tmLHVx466mSQa0TqmuCiToKBRuKuOseRqnGq Gml5hiUyEatVc4qJMfkKWni3IoWR4ibmddYMBGEL3fW972dcm48SEP9ZP3Za2PWbTpyI i8t88NzPcXhNhFycj24ellEqsXhB4c22nMs8D585Z5vc0AwZys9mXoudoLIzRENrFxO8 lq75calwfWz8/++eGM9XDN1ZNSWKtjoDLvy5mSAqWMobIpPB/wjxGNN5jsaX4PZ0htKG wZ5A== 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 ec13-20020a170906b6cd00b00723fe13e988si21251286ejb.244.2022.06.29.23.34.47; Wed, 29 Jun 2022 23:35:11 -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 S232633AbiF3GF3 (ORCPT + 99 others); Thu, 30 Jun 2022 02:05:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230099AbiF3GF1 (ORCPT ); Thu, 30 Jun 2022 02:05:27 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B83F3E9C; Wed, 29 Jun 2022 23:05:25 -0700 (PDT) Received: from mail-yb1-f180.google.com ([209.85.219.180]) by mrelayeu.kundenserver.de (mreue108 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MDykM-1nwr8Z15L2-009u4R; Thu, 30 Jun 2022 08:05:23 +0200 Received: by mail-yb1-f180.google.com with SMTP id v38so21245765ybi.3; Wed, 29 Jun 2022 23:05:22 -0700 (PDT) X-Gm-Message-State: AJIora9mLhIkWMU2pw0+qpEOolnlhrptNeZMdvQLOvLxTO90T/tXSL5O zFetecC19nQkamKR5oVGPtfJuS7QEDEtWLhuApw= X-Received: by 2002:a05:6902:120f:b0:668:2228:9627 with SMTP id s15-20020a056902120f00b0066822289627mr7959756ybu.134.1656569121704; Wed, 29 Jun 2022 23:05:21 -0700 (PDT) MIME-Version: 1.0 References: <20220630043237.2059576-1-chenhuacai@loongson.cn> <20220630043237.2059576-4-chenhuacai@loongson.cn> In-Reply-To: <20220630043237.2059576-4-chenhuacai@loongson.cn> From: Arnd Bergmann Date: Thu, 30 Jun 2022 08:05:04 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V2 3/4] mm/sparse-vmemmap: Generalise vmemmap_populate_hugepages() To: Huacai Chen Cc: Arnd Bergmann , Huacai Chen , Thomas Bogendoerfer , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Catalin Marinas , Will Deacon , loongarch@lists.linux.dev, linux-arch , Xuefeng Li , Guo Ren , Xuerui Wang , Jiaxun Yang , Andrew Morton , Linux-MM , "open list:BROADCOM NVRAM DRIVER" , Linux Kernel Mailing List , Linux ARM , Feiyang Chen Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:isWkHM0zBfXkwCpnGWGutHkS/c7PTfYL+kPwzmCZnPTaur1N43j trEAds4ISXh8H43i7dfbkWSQ4tq8gEWi9JKyY4iCJb/J4SD5dAW9u4Qx4iGNM7YwKyKMbuL edDZoYeSJyIN+4bVRBDeeiiE2nDFLNfA/uaQ4aVs590jrjV1km5pJEbwcYcCL8jzX0/xM/1 mMSS5KFxjXx25Cx8ptu9Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:K/dru+AXhPE=:25UZ8NKGZcBrkp36/wp5Gn 0GqcT8r3sqJsAykWyp2uHh4zhJ0NgQQFNNldEGODKTiGV1wnvD3CULKr10UmH1OwtBlJcEoNg pXTa1PyWq9+nTiK9JnSh/+zWV3UmpkaQtnoFuzV9UvbsPaZw12uotwhR+zGqbs4oMuaBpPqdd eSkWZiPn5yT12e+1++b7pwmHdPhMjHizyTefRfKfx+5BVva82sfqZp0ksS2jqU4wcXx5fiGb7 MSMMiUQy6hDUdIySZZIG3NfBLXSZzvoJFxcwp+9picXPP0RdYVSeCqNfBbp9EC6cHSqGANztP oUypRoKgLbGZiEgpLGUu1k7l+bz2vU+RbR2kNkZ+V137r30NXpN1VDQmXdToQxUNXNN1DKImz EpOnGE8mqN0Yyk6xCTtofapJ+ytJyOGT2mCHeNTpzZV9sZvUkiq+377Bh3LUNLbHoUPi25rE2 0A0Ul+KtW71sOhOtTQiZxjJa+nXe+dV9QXUI58YVVjE2yRIpHebVmxPk3lPStnFzoK1zU+KJx F840O+8k7kQqeL3p+B1W0n1RnLARAgN2VbSapitu43we4+FkpcQg9+7J2TobO2UTq3yBSDrcl R5bXusXaKOIRMkA8kkdUplPn/3SA4LalgAQLFQcWoNLN43FYrcfbfDc8YNFpp8IbdTzYxvObt QswESTXgyebxy22XJI9SJ7zQYSMgr36k15TrPEAL+dUqPP2RaZ6lU0Pu+fLNCg/GcVJj2szbD tJybH4N+QGrusm9GOU6xKSpwGYv8lMNsoDBvZV9r9DyCLYkgHVXZb9M0dycDkyfhLbmyY7YPI YEgfnDZFdyOJnvycE4OxQJ32FpQViCqt3oYEZ4DTjw5CKfmZozsekrwz31uSHYLDm3TCE2KQE jAma2Qnb4k9xIC6ZY+DQTFlC4nxLJMVyBclhq11Bc= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,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 On Thu, Jun 30, 2022 at 6:32 AM Huacai Chen wrote: > > From: Feiyang Chen > > Generalise vmemmap_populate_hugepages() so ARM64 & X86 & LoongArch can > share its implementation. Sharing this function is good, thanks for consolidating this > Signed-off-by: Huacai Chen > Signed-off-by: Feiyang Chen The Signed-off-by lines are in the wrong order, it should start with the author and end with the final submitter. > index 33e2a1ceee72..6f2e40bb695d 100644 > --- a/mm/sparse-vmemmap.c > +++ b/mm/sparse-vmemmap.c > @@ -686,6 +686,60 @@ int __meminit vmemmap_populate_basepages(unsigned long start, unsigned long end, > return vmemmap_populate_range(start, end, node, altmap, NULL); > } > > +void __weak __meminit vmemmap_set_pmd(pmd_t *pmd, void *p, int node, > + unsigned long addr, unsigned long next) > +{ > +} > + > +int __weak __meminit vmemmap_check_pmd(pmd_t *pmd, int node, unsigned long addr, > + unsigned long next) > +{ > + return 0; > +} > + I think inline functions would be better here, both for compiler optimization and to make it easier to track the code flow. The normal way we do these in architecture specific headers is to override the functions by defining a macro of the same name. Arnd