Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2866464pxp; Tue, 22 Mar 2022 07:30:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUNqjRIQn1LiRSBvWhQ1eggxjsdx4ZU/+STCSuHLb4+nCpIkTnLIQ+tWhtYcq6Bg+e7UpC X-Received: by 2002:aa7:81ca:0:b0:4f6:d297:4213 with SMTP id c10-20020aa781ca000000b004f6d2974213mr28882948pfn.59.1647959451640; Tue, 22 Mar 2022 07:30:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647959451; cv=none; d=google.com; s=arc-20160816; b=MiW61aWVvbIN6OdYK02h5wA8iWJ3kRhQZGhETW4TbMsrDSyKjb6sGcsfs/a/T49uCT ZDcN6GPiBYuizEcom3abgY5MdRbRygHdo0ODlW9SyjHpsrAFt5a2aAZL4tQUeLWy6P+Y HS94H8o/tKs2gUWsB2vD/pBdvSU83v5iWW0mzTCNOrvRSwVa5461vtm+5IetslNIK8VS qlUIimQwipVxIYJRss5WvRSpt8u3ztKCy4NUeeETZDnnJ/2pa47qO85UcTJmAlKG5S72 C3LrJoJ1whlKVGBPpjx7eOlgUTZWkaWtB2LKKqvjt73LvpaE6KmCq5F5nXxAWCIeTfRN 4JOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=Iq17f1d6WDzZIj+LCJ2gSlurEnU5chlu8q4xCYvcv4w=; b=XGyP3civDfMgXCE5gQfClpnZqHkz2hsTKy4OFTNlB0IIpRfKDJ4Mgb1WQEw4bQxNm7 QeiaNNHEQrzRRLCwTMJEYRJqMwpPw/6s9dCmJ2e53QuzIZRZ6EvguCz/qPAx47kFCGfH iuRlFkLG7hvy3bGE6tgV3VjHgoaTMhhsw1QA3q2Rsy+AdoI76C+Pb0L7mq8WqiPj9D2W 4hcbPzHF0D9/OQGn005grUkYbcVUSblirjv/QjguZBYdLrkxAf4ZXRQ06x2WwDoUEZrk lAFoqgOQzC5TZn2UlAJPGp9aCvEdYBgy9QmkmO39d8lDPTmJIDgyh1V2e0mG+Ha7cpwY WXvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm2 header.b=zNrv8VHN; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=GG4iMedJ; 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 l3-20020a170902eb0300b00153b2d165edsi13036580plb.501.2022.03.22.07.30.36; Tue, 22 Mar 2022 07:30:51 -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=zNrv8VHN; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=GG4iMedJ; 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 S235301AbiCVNUh (ORCPT + 99 others); Tue, 22 Mar 2022 09:20:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231388AbiCVNUg (ORCPT ); Tue, 22 Mar 2022 09:20:36 -0400 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8F8F65D0E; Tue, 22 Mar 2022 06:19:05 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id E2E283201487; Tue, 22 Mar 2022 09:19:04 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 22 Mar 2022 09:19:05 -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=Iq17f1d6WDzZIj +LCJ2gSlurEnU5chlu8q4xCYvcv4w=; b=zNrv8VHNtBwtTaBqt7m5brV09gqhoB ioyy/DExZO4OgVoMTK1/SZUW9HI3LWcibrJMimy+mxmKoXOruzytcBJhhyR4+EnP dPGWq3rqFjczc/In7Q7MSUIP7LveGlm6fmJDABgrPahrWsFii6bevbYc3umHLINr sEYhiJpS++QDmTE4YqjucxRoX9si+WKMfAri5lsD/j7vJWQMDko+ZWmYyGVWy7i8 94c8kjUWccMvhSy2y/lha1kwayE9lB+U3DLkHIHTvYmX93V7ypHkcpQ4F3QAh3wH jCTirsE9fripT7KIciiqk/7aTrotpZDpOPwIvduzOqKZGpqleswL2QWQ== 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=Iq17f1d6WDzZIj+LCJ2gSlurEnU5chlu8q4xCYvcv 4w=; b=GG4iMedJ8xu2rfi4ILWyTPnLQxQsc2s6hvxfOQme/th7M4EHjUv63KSUu uFkvZCPAJTdJwzVqcrvlFEsuzTmJFXhYSl5JgKmpZ01ovyF2XWmBKu4HLCJT/d8l qVbrkMXXGpZXvjjlYlHXsUqG+7mmrlPK9jMG31MGiJNgfdJxvvOjRntpS6GCoFl6 tlsuE2ETc1xKlNxwXGptI7GUM35pcc9+VM6wBIkdY1PIIARgnBmzY9SC7ekUXSUc NUDgVJ2ilGXAXJwdKC5DHcdyrOqLuLfC7V3LQ90ojyD1aoUq9uOYEemp5mhbuG9Y 4ds9q9dWzACv3600VW008qc/TKLiQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeghedggeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheplfhirgig uhhnucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhmqeenuc ggtffrrghtthgvrhhnpeehieduvdevhfekjeeftddtkeeitefhudekvdeiueeulefgleei jeeghedvkeduleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 22 Mar 2022 09:19:02 -0400 (EDT) Message-ID: <33241bd3-2f12-954c-6701-56cf563060bb@flygoat.com> Date: Tue, 22 Mar 2022 13:19:01 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 3/3] MIPS: Use memblock_add_node() in early_parse_mem() under CONFIG_NUMA Content-Language: en-GB To: Tiezhu Yang , Thomas Bogendoerfer Cc: Xuefeng Li , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org References: <1647615920-23103-1-git-send-email-yangtiezhu@loongson.cn> <1647615920-23103-4-git-send-email-yangtiezhu@loongson.cn> From: Jiaxun Yang In-Reply-To: <1647615920-23103-4-git-send-email-yangtiezhu@loongson.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,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 在 2022/3/18 15:05, Tiezhu Yang 写道: > 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 ? 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_NONE); > + else > + memblock_add(start, size); > > return 0; > }