Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1947020pxb; Fri, 25 Mar 2022 08:25:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJeVS2/DVWSvgt2R9bVsBMFXijycvuEW08e8TrEcZiherOvNZoFlb4nYkb6spsryh7Yqwn X-Received: by 2002:a05:6402:42c6:b0:419:276a:dded with SMTP id i6-20020a05640242c600b00419276addedmr13915412edc.2.1648221950748; Fri, 25 Mar 2022 08:25:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648221950; cv=none; d=google.com; s=arc-20160816; b=HnAHKnwzt36rOilY/LVP7jCr2VJmguCCrwxZUeS0kZRBeij4ja22t7t8fbC42Ow7l+ GSpO0iY407ge7S9FWs/zCVubialJsDvPu8pdLnYkKX8XRqvz9ywypPJd94ALHIHPgQcK 9QSjshZq2pABWgbJc9fp7bai34jm4E+jPhoTQUoPfzEGp26ZAN9/YgkudCq4mRgcMQ0P g1KBLLDKyTAndf40KYcs63GFEECKuSsBROZ4p3Kero9HlLVeoZMtf0EgpCyEKFCa4/ZY PMUdt4+UZlwoBwX91dnAmArz3I40r/ruIX+sNeRErfXOYx6DXzsdevM+Sld2u9E/iH2F Rxyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:cc:to:from :date:references:in-reply-to:message-id:mime-version:user-agent :dkim-signature:dkim-signature; bh=Up3dHTMXn3+4fLUoQJEi2QXNKuRNdeUTtoLiyFBrbHM=; b=kNCqgVz968XyCOQezSH5efJqeGoV6wrgWOUA3clo211gQzwQb1XHsjHwz84dsGyZjJ cfQFmqo2LyaJ+P3WPUuAhxybGfwvoPl05bA5HFOpU9b1V2l5hhqNnM8cBo0U2MsucNR8 uAlHFa33VTB8CI+VDmY5AGQgq4om85hNQ7L1i16pIe6ZdqrzkYe6IBPE6Iv8jfFLMyGt tBAHxPb+QztCtFOfSDs2r8LE7V2Ov/VGvvnET0o5W2YCytGSeB/+nTN7ySLwRRp//bfC yLDtj70Kt0wuFwRMIwTsi6t07oOVCwmhBWK5ZSlA6sJB5D37Z56UI8HVcJ5pt67mX60L IVEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm2 header.b=y9MiYRW2; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=nM7p8Gqm; 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 u16-20020a170906c41000b006df76385be9si2822203ejz.137.2022.03.25.08.25.24; Fri, 25 Mar 2022 08:25:50 -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; dkim=pass header.i=@flygoat.com header.s=fm2 header.b=y9MiYRW2; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=nM7p8Gqm; 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 S1350219AbiCXMb3 (ORCPT + 99 others); Thu, 24 Mar 2022 08:31:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350215AbiCXMbY (ORCPT ); Thu, 24 Mar 2022 08:31:24 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E73FFA995A; Thu, 24 Mar 2022 05:29:52 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id D99535C014D; Thu, 24 Mar 2022 08:29:51 -0400 (EDT) Received: from imap44 ([10.202.2.94]) by compute1.internal (MEProxy); Thu, 24 Mar 2022 08:29:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; bh=Up3dHTMXn3+4fL UoQJEi2QXNKuRNdeUTtoLiyFBrbHM=; b=y9MiYRW2H0kvGQzUrfOSK49obI2x2v k3hmCDgVcsW5ejjQwtxVh3M80/wXFTbFwm3zPmwDhCT5op4dLd5ic7ef0Q9oYJYA OsJhez+oHpUzG6LaOLRNiY3chK3U70ObYI6doFNbRdXGzdCfDKprBiCDX0+/VZBG lG9UYeBAkhot8/BdV7Jx8jDARk4dLluVXfMslc6HW+eLyQWlOtfAPsL2vvma/zDL crtY1YKRuEGHuB+XHMsYd/84K/3xiUFQejncBFMRyM3qrrUo1dILeoJHoVglGU6b sOL5hDSnOqngl+7/vc9jcjQf7d1Batro8RmhFyQDzXM9Wm3/WqZc/nAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=Up3dHTMXn3+4fLUoQJEi2QXNKuRNdeUTtoLiyFBrb HM=; b=nM7p8Gqmnsgq/0LE2Ng99N0xuYBHq3UhCUY5NVZ32LQBa+BEgCb6pV31i tvJrgkWuHvwwWGU2ozl+T9tJk407AWgK6kSY+OxPh8NADs/oJsUKKmJl1UBmvtn3 CzVLUQOisYtBp9oULeZ9grWvpQZkDHLva/CyFR/q4lGhmKAd4uxARx0uBW47nRmL J+eNQzmnmV6Bft8daqgJ24iHl7wrJYWdPI1mnOQPovg0338ppxeWmEu0fXpt86+G 4DJx09AgKAoVpy0tz7GHbR1GxybRNGjZLy72BVwh0hR4ZLDKQSXtkLp7HMJ2sQGU b61c9FEbBMRe6h1Ykp9rP887L6Yvw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudegledgfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpedflfhi rgiguhhnucgjrghnghdfuceojhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh eqnecuggftrfgrthhtvghrnhepfeetgeekveeftefhgfduheegvdeuuddvieefvddvlefh feehkeetfeeukedtfeejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 3F51FFA0AA6; Thu, 24 Mar 2022 08:29:51 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-4911-g925b585eab-fm-20220323.003-g925b585e Mime-Version: 1.0 Message-Id: <490570bf-0e91-471b-b081-5ebd35541522@www.fastmail.com> In-Reply-To: References: <1647615920-23103-1-git-send-email-yangtiezhu@loongson.cn> <1647615920-23103-4-git-send-email-yangtiezhu@loongson.cn> <33241bd3-2f12-954c-6701-56cf563060bb@flygoat.com> Date: Thu, 24 Mar 2022 12:29:28 +0000 From: "Jiaxun Yang" To: "Tiezhu Yang" , "Thomas Bogendoerfer" Cc: "Xuefeng Li" , "linux-mips@vger.kernel.org" , linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] MIPS: Use memblock_add_node() in early_parse_mem() under CONFIG_NUMA Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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 =E5=9C=A82022=E5=B9=B43=E6=9C=8823=E6=97=A5=E4=B8=89=E6=9C=88 =E4=B8=8A=E5= =8D=882:42=EF=BC=8CTiezhu Yang=E5=86=99=E9=81=93=EF=BC=9A > On 03/22/2022 09:19 PM, Jiaxun Yang wrote: >> >> >> =E5=9C=A8 2022/3/18 15:05, Tiezhu Yang =E5=86=99=E9=81=93: >>> Use memblock_add_node to add new memblock region within a NUMA node >>> in early_parse_mem() under CONFIG_NUMA, otherwise the mem parameter >>> can not work well. >> >> Hi Tiezhu, >> >> pa_to_nid doesn't exist when CONFIG_NUME is disabled. >> So probably you want #ifdef macro instead =EF=BC=9F > > Hi Jiaxun, > > Thank you for your reply. > > As far as I can tell, if CONFIG_NUMA is set, IS_ENABLED(CONFIG_NUMA) > is 1, pa_to_nid() is defined in the platform dependent header file: Yep you're right. Apologies for the noise. For the whole series: Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang Thanks. > > arch/mips/include/asm/mach-ip27/mmzone.h > arch/mips/include/asm/mach-loongson64/mmzone.h > > if CONFIG_NUMA is not set, IS_ENABLED(CONFIG_NUMA) is 0, pa_to_nid() > is always 0 which is defined in arch/mips/include/asm/mmzone.h: > > #ifdef CONFIG_NUMA > # include > #endif > > #ifndef pa_to_nid > #define pa_to_nid(addr) 0 > #endif > > So pa_to_nid() is defined under both CONFIG_NUMA and !CONFIG_NUMA, > there is no build error. > > Additionally, use #ifdef CONFIG_NUMA is also OK, but I prefer to > use IS_ENABLED(CONFIG_NUMA). > > If I am missing something, please let me know, thank you. > > Thanks, > Tiezhu > >> >> Thanks. >> - Jiaxun >> >>> >>> Signed-off-by: Tiezhu Yang >>> --- >>> arch/mips/kernel/setup.c | 6 +++++- >>> 1 file changed, 5 insertions(+), 1 deletion(-) >>> >>> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c >>> index c8c8f60..50cdc08 100644 >>> --- a/arch/mips/kernel/setup.c >>> +++ b/arch/mips/kernel/setup.c >>> @@ -37,6 +37,7 @@ >>> #include >>> #include >>> #include >>> +#include >>> #include >>> #include >>> #include >>> @@ -378,7 +379,10 @@ static int __init early_parse_mem(char *p) >>> memblock_end_of_DRAM() - memblock_start_of_DRAM()); >>> } >>> - memblock_add(start, size); >>> + if (IS_ENABLED(CONFIG_NUMA)) >>> + memblock_add_node(start, size, pa_to_nid(start), MEMBLOCK_N= ONE); >>> + else >>> + memblock_add(start, size); >>> return 0; >>> } --=20 - Jiaxun