Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2918742pxb; Mon, 19 Apr 2021 18:06:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyB8P3i3lNmay1rQ8KJUi99+u+2TIoLJ/yt8UwkYyG/4vva0SNU8Ttab016Ieoqm6lS3IEi X-Received: by 2002:a17:906:3952:: with SMTP id g18mr24706466eje.104.1618880801585; Mon, 19 Apr 2021 18:06:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618880801; cv=none; d=google.com; s=arc-20160816; b=yAtzUCoHFXOVHy71GrrCgRwLSp0wWpKtJ5Q2FAw7K/xnuv1Bt899tDrB2/rP729As6 Z9m/07naPbQGTQO+cavSkNSNHigaL9ii86mrEc906div+lcrlNafCxjt6ATMseXRjce3 g7o2hABJOK8bXAZsdwhOcEfAtJwe72id+2f+tTi7g9Anfq2UOgtNAR+NtShbQJ5TOxIC ZDqZXhZA/DSJe7xs/uIyLD61y6M9Z/kt2bfHhgzOy8/Lli79FDxZzPMPYVd17I/5E4uJ ZNsyfCfPdgTtfSP7GSjhkUw9rhV7LpElSbOPax+E3XQwlcLysvRd4rPf1DhQ/hgpevb7 Iajg== 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 :mime-version:user-agent:date:message-id:from:references:cc:to :subject:dkim-signature:dkim-signature; bh=mlDNUFTdljTuo1j+3cYYINuiqgbp1NrIIwQpWn3MBNc=; b=JJioOjgv3lzQwTGl+xyw/NLv/Lnc/MsWz8bCBYpU3RJ6SVZipwbRUZ6kjwkEmIyw7d sFMWTQmQ7Juv6QQ+JMPTJBPMDj79lEHwKcVyar26HcGUtbs4Nrpt92m7agtKx5QN1aOD Q/bLUgPLPZaKLTwGpQTE3Bl6tGhxDZgUaubkbT9kHWVAhywJQbyWRQmbAIGGlkI8Agcd /D1s/QLScFanXJPJn+qa9scLETkrwpPqXT8v1n22HnAHr6O1wpHucWu+xKb//w2TB71A QVe6eOAP9ZvGULF6jso4H2lCN2R3Ja1JAbq6KLNYcOB93Ps/YBjQ0S06XUo8JFLfiSzu HG+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm2 header.b=Ipn3WzyE; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=JUvJk1bc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j16si16565328edj.401.2021.04.19.18.06.16; Mon, 19 Apr 2021 18:06:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm2 header.b=Ipn3WzyE; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=JUvJk1bc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229994AbhDTBFn (ORCPT + 99 others); Mon, 19 Apr 2021 21:05:43 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:47895 "EHLO wout3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229936AbhDTBFm (ORCPT ); Mon, 19 Apr 2021 21:05:42 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id E45712985; Mon, 19 Apr 2021 21:05:10 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 19 Apr 2021 21:05:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=m lDNUFTdljTuo1j+3cYYINuiqgbp1NrIIwQpWn3MBNc=; b=Ipn3WzyED2LdkvZOB wQ37BFZzgO3FjwOC0NY4Nn597HQEtpbI9FecaNqAfOR4yBnjWlkB38vDtugjcaGD /oXSiRQqAXuEFSZj1kdaRl3G59DbU/qsNlt7xrHuhdJjl1/ObPY++1zYa+Z1PtOm OvAWyV8Gwhlm8xvqFVb5GNf08gQUqlxrBZ/XwJlN+cHmxgLi3yTT1Nr48lLuYtBP /u3Qr2qhPvGDHA7sJW+73W/q0f0u6F4u7y1isMhORe9y6KVOw9piV9sX0x1hUtZD Dbl/OOiF48m6m/newK/LKSxSdofcyXMPLIY7jLpzlbD1UdOYpMJad5vuAmA/DgTQ UVkCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=mlDNUFTdljTuo1j+3cYYINuiqgbp1NrIIwQpWn3MB Nc=; b=JUvJk1bct7smH54sq0HpQ73mC0wV7aPeKzwpqqY/XEPfnjqdvaioala9x 4BW90bjJLs2CYohUDllveNqcw6Zs8oPrQxa8uhim8TtOP+Uy2yQ9pRCi+mff5ZXZ eLePEHBjPOKAm77CTX7OnJmzEBLtM8vzg/JYWFYnoo0IHBmNfHd6hUOBkaYQaVYe n5qR1rmWCcvcYC2RZtXCHKSB+GIqr2WHAVURXAV99YO86VqdT4rw8+qDsR56qt8F 9burQyuamn6cG7MgZo5C5Rrx5R/olyf+xFy8LGExz21Wi/bLci+gYN0s7woqffiP BOqTkie/9Rn6pMjZxZSCjx8n5fZqA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddthedggedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheplfhirgig uhhnucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhmqeenuc ggtffrrghtthgvrhhnpeeihffghfeikedugeejvefgffevgeevgeehfffhudeiieffffev ffeugeevfefgfeenucfkphepudduiedrvddvgedrvdegjedrgedunecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgiguhhnrdihrghnghes fhhlhihgohgrthdrtghomh X-ME-Proxy: Received: from [10.20.195.140] (unknown [116.224.247.41]) by mail.messagingengine.com (Postfix) with ESMTPA id 2BBA624005E; Mon, 19 Apr 2021 21:05:06 -0400 (EDT) Subject: Re: [PATCH] MIPS: Fix cmdline "mem=" parameter parsing To: Youling Tang , Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Jinyang He References: <1618829425-11873-1-git-send-email-tangyouling@loongson.cn> From: Jiaxun Yang Message-ID: <5d4d31aa-7fe5-bf8d-1d77-a1605f0c2793@flygoat.com> Date: Tue, 20 Apr 2021 09:05:02 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <1618829425-11873-1-git-send-email-tangyouling@loongson.cn> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2021/4/19 18:50, Youling Tang 写道: > This problem may only occur on NUMA platforms. When machine start with the > "mem=" parameter on Loongson64, it cannot boot. When parsing the "mem=" > parameter, first remove all RAM, and then add memory through memblock_add(), > which causes the newly added memory to be located on MAX_NUMNODES. > > The solution is to add the current "mem=" parameter range to the memory area > of the corresponding node, instead of adding all of it to the MAX_NUMNODES > node area. Get the node number corresponding to the "mem=" parameter range > through pa_to_nid(), and then add it to the corresponding node through > memblock_add_node(). > > Signed-off-by: Jinyang He > Signed-off-by: Youling Tang > --- > arch/mips/kernel/setup.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c > index 279be01..b86e241 100644 > --- a/arch/mips/kernel/setup.c > +++ b/arch/mips/kernel/setup.c > @@ -359,7 +359,7 @@ static int __init early_parse_mem(char *p) > if (*p == '@') > start = memparse(p + 1, &p); > > - memblock_add(start, size); > + memblock_add_node(start, size, pa_to_nid(start)); pa_to_nid is not available for all platforms. Thanks. - Jiaxun > > return 0; > }