Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2574350ioo; Tue, 24 May 2022 00:35:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8wPeZL3zcfjApmx9Gv5SiQPiDH2D4vyyDhKs5ww3TXzP/aOsxBEi8BaNbV6GtBg2ycRvw X-Received: by 2002:a17:906:b0c5:b0:6f3:bb5e:54a8 with SMTP id bk5-20020a170906b0c500b006f3bb5e54a8mr23924425ejb.534.1653377748001; Tue, 24 May 2022 00:35:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653377747; cv=none; d=google.com; s=arc-20160816; b=UObfHul4aimP1OnTNgJpmYtvF6OgU4tD8hLWe7ZbqXsRM/Pm37/IWlYde3mvoLR3yo fvoPjVEqvXbk8rPW4DargstYgNAytVsZP80E6ct/e/pNxujjMgYyu5I5diFpIWMKfS4J 3EGEqEXXIpk3pTo5HwdFEFYoiIxvC7l3k6AEYzY0eAPIzybg0uyWcZtEb91VCJ+HVeZp +hvmkWD+7rkHSmv7iGFfNE7P6fmMreA56G3y/VFxKGeaGWWVmcVJnzO/U87ofY+VXYa0 qfaPBQf/VUXDo/NKUik1nqcrTqKAbz+MrHLrgsBusKoYWfN3w+EVhL5NBiQ8xSRlzRHy qrTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=19Rh9ZurbwUdgzJe95rACKzhBHqfpjcDXDY37yFp68c=; b=Xgj+dfCiqLJenxfV4+ew0L8/Yxq1CO6FzWoubQVfApcx76OsNZFqxpnrtmpgeey7yd wT1wshSdgCacFo+LvDZCHYnKob2v44uataaa0y1KaIT8O1rt/goFiHONsoyOVEES/oT2 +uLxX54TKY8nh8N22H4cd8OBLLoB6OuwcdBUd0Jk0FPmjYAg8plOByghs3s2peYFjT1n dHnhLO2aLnKBUfeIqOj4CKkPSCoINDeXN2CgdTSxeOs3yWZSKR+Xj3u9/z2DANVW9e06 C3yDeVDqHlIBUZWZOYN5kql9BXylWydh0lFYNIF1tibmUHG+YIVtPo4N9KBaWXuHH/jl wRog== 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 k5-20020a17090666c500b006fef85cfcd4si3090325ejp.384.2022.05.24.00.35.21; Tue, 24 May 2022 00:35:47 -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 S233190AbiEXC2B (ORCPT + 99 others); Mon, 23 May 2022 22:28:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232822AbiEXC1x (ORCPT ); Mon, 23 May 2022 22:27:53 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C5B2C694B5; Mon, 23 May 2022 19:27:52 -0700 (PDT) Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9DxvyqmQoxix8cgAA--.5133S4; Tue, 24 May 2022 10:27:51 +0800 (CST) From: Tiezhu Yang To: Thomas Bogendoerfer Cc: Xuefeng Li , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] MIPS: Use memblock_add_node() in early_parse_mem() under CONFIG_NUMA Date: Tue, 24 May 2022 10:27:50 +0800 Message-Id: <1653359270-27056-3-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1653359270-27056-1-git-send-email-yangtiezhu@loongson.cn> References: <1653359270-27056-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf9DxvyqmQoxix8cgAA--.5133S4 X-Coremail-Antispam: 1UD129KBjvdXoWrtFyDGw4DGw1kAw1kKw4kWFg_yoWDGwbEyw 1S9r4kG34ayF1jvr47X3s3Wa4jy3yUXFyxuFna9r42y3s8JryUG393Ar1DZrs8ur1DArn5 Zr9xCrWUCan7WjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbhxFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUXwA2048vs2IY02 0Ec7CjxVAFwI0_JFI_Gr1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVW5JVW7JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwA2z4 x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r4UJVWxJr1l e2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI 8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwAC jcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lc2xSY4AK67AK6r4UMxAIw2 8IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4l x2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrw CI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI 42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z2 80aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUb5fHUUUUUU== X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 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. 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 1c7f916..2ca156a 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -364,7 +365,10 @@ static int __init early_parse_mem(char *p) if (*p == '@') start = memparse(p + 1, &p); - 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; } -- 2.1.0