Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2275153pxm; Fri, 4 Mar 2022 12:54:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzdTyFla+zFG83CSt6nQpdmEov0zB+YEj3AObXSkv44mbdkYUEY2/m4zwPRU7T7fKtJxi54 X-Received: by 2002:a62:d141:0:b0:4f3:c07b:7bf5 with SMTP id t1-20020a62d141000000b004f3c07b7bf5mr426511pfl.41.1646427248817; Fri, 04 Mar 2022 12:54:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646427248; cv=none; d=google.com; s=arc-20160816; b=0mZegVpYLnf5+6WVEjuNbl2maBb9QjIDNxtaeJwX7GyVukKrapfnT3s/UzZxD2H9j6 tg+DVLid3Ezkj7hTYoRBwEj3zbWc1jABr4N7YMdTn44Di8YdJQzFu4vWLSIJJINSvL23 fnkOjPCRuf15zMbh0NxR3UwHyduO/siR9sgYGjd4+7c6mcQEhKWHK0QIdJB8Avh/fcVj 3/zwfWMXvoNFwx0OQoMRr2EGY+3WF1iiZj8C3dc/qHYSqYtnPd6r4Qtna50MVEcXbjFl t/gef8TL/f6SJgia2T8OXxuoW091G8XQ7Y9nWFUDV7U6WYXUYSBRvn0JwbLQf+ALh9FM U6Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=DKnFMf6VCTbR+lTpe2ovdLHqMX0Me/tFHAgRWddg1G8=; b=CF5bW0IxntVXrimPi2u/48CvHc7irliRH+WLko6qJM6KPgeYBEOLJAk+2NDsIDmDt8 tQZvU3IUNyCBDquRqZC/DLuWkSy6IWA/5BVfHnJlz66CWmpWjg4dDPAHX8nrBJlKgycC 29XQYLJMCfcCcAFHbKaE/c+Q8xlxlhxoMQisLffNb2xJxDh1LcOhPtpDJ2E9L+jrtNh4 AzpPxDyhUzJezctu6fCHX0kHCM6GM0SZ4b/lceg3q9EOIKZCjVYlPZbF0UOmB8+esUIZ LpBC8LPOTD1Ixye4RxQompfx8gf4rG7m39TJzjeeMEJBJhIK9yWze4DVenmKKTzhV9Hj CE9Q== 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 16-20020a056a00071000b004e027138621si5718774pfl.217.2022.03.04.12.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 12:54:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DEAAEC2E59; Fri, 4 Mar 2022 11:47:54 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240369AbiCDPgS (ORCPT + 99 others); Fri, 4 Mar 2022 10:36:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233371AbiCDPgQ (ORCPT ); Fri, 4 Mar 2022 10:36:16 -0500 Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8F1391C57FE; Fri, 4 Mar 2022 07:35:28 -0800 (PST) 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-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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 ]