From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81151C433F5 for ; Fri, 4 Mar 2022 15:35:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A59998D0002; Fri, 4 Mar 2022 10:35:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A08AF8D0001; Fri, 4 Mar 2022 10:35:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8F7258D0002; Fri, 4 Mar 2022 10:35:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0062.hostedemail.com [216.40.44.62]) by kanga.kvack.org (Postfix) with ESMTP id 8139D8D0001 for ; Fri, 4 Mar 2022 10:35:29 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 3F46F9AC8F for ; Fri, 4 Mar 2022 15:35:29 +0000 (UTC) X-FDA: 79207103178.21.BD9E7D8 Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by imf20.hostedemail.com (Postfix) with ESMTP id 6825B1C0021 for ; Fri, 4 Mar 2022 15:35:28 +0000 (UTC) Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1nQ9xm-0008Sv-00; Fri, 04 Mar 2022 16:35:26 +0100 Received: by alpha.franken.de (Postfix, from userid 1000) id 3620EC0F8D; Fri, 4 Mar 2022 16:35:17 +0100 (CET) Date: Fri, 4 Mar 2022 16:35:17 +0100 From: Thomas Bogendoerfer To: Tiezhu Yang Cc: Mike Rapoport , Andrew Morton , Xuefeng Li , linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/4] MIPS: Refactor early_parse_mem() to fix mem= parameter Message-ID: <20220304153517.GA28487@alpha.franken.de> References: <1646108941-27919-1-git-send-email-yangtiezhu@loongson.cn> <1646108941-27919-2-git-send-email-yangtiezhu@loongson.cn> <20220304151052.GA27642@alpha.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220304151052.GA27642@alpha.franken.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 6825B1C0021 X-Stat-Signature: bcipqci3pa9cs8e5nrxy5bobrpkk4wyj Authentication-Results: imf20.hostedemail.com; dkim=none; spf=none (imf20.hostedemail.com: domain of tsbogend@alpha.franken.de has no SPF policy when checking 193.175.24.41) smtp.mailfrom=tsbogend@alpha.franken.de; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1646408128-185730 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Mar 04, 2022 at 04:10:52PM +0100, Thomas Bogendoerfer wrote: > On Tue, Mar 01, 2022 at 12:28:58PM +0800, Tiezhu Yang wrote: > > According to Documentation/admin-guide/kernel-parameters.txt, > > the kernel command-line parameter mem= means "Force usage of > > a specific amount of memory", but when add "mem=3G" to the > > command-line, kernel boot hangs in sparse_init(). > > > > This commit is similar with the implementation of the other > > archs such as arm64, powerpc and riscv, refactor the function > > early_parse_mem() and then use memblock_enforce_memory_limit() > > to limit the memory size. > > > > With this patch, when add "mem=3G" to the command-line, the > > kernel boots successfully, we can see the following messages: > > unfortunately this patch would break platforms without memory detection, > which simply use mem=32M for memory configuration. Not sure how many > rely on this mechanism. If we can make sure nobody uses it, I'm fine > with your patch. maybe we could add a CONFIG option, which will be selected by platforms, which don't need/want this usermem thing. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]