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 84C66C433FE for ; Mon, 7 Mar 2022 23:09:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 041268D0002; Mon, 7 Mar 2022 18:09:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F32978D0001; Mon, 7 Mar 2022 18:09:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E21EA8D0002; Mon, 7 Mar 2022 18:09:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0161.hostedemail.com [216.40.44.161]) by kanga.kvack.org (Postfix) with ESMTP id CEE6D8D0001 for ; Mon, 7 Mar 2022 18:09:32 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 8AD7B181F9318 for ; Mon, 7 Mar 2022 23:09:32 +0000 (UTC) X-FDA: 79219133784.23.06EC281 Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by imf04.hostedemail.com (Postfix) with ESMTP id C959040006 for ; Mon, 7 Mar 2022 23:09:31 +0000 (UTC) Received: by angie.orcam.me.uk (Postfix, from userid 500) id BCAF992009C; Tue, 8 Mar 2022 00:09:28 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id B5C4A92009B; Mon, 7 Mar 2022 23:09:28 +0000 (GMT) Date: Mon, 7 Mar 2022 23:09:28 +0000 (GMT) From: "Maciej W. Rozycki" To: Mike Rapoport cc: Thomas Bogendoerfer , Tiezhu Yang , 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 In-Reply-To: Message-ID: References: <1646108941-27919-1-git-send-email-yangtiezhu@loongson.cn> <1646108941-27919-2-git-send-email-yangtiezhu@loongson.cn> <20220304151052.GA27642@alpha.franken.de> <20220304153517.GA28487@alpha.franken.de> <20220307162909.GA18728@alpha.franken.de> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: C959040006 X-Stat-Signature: boxk36ynwweqizfj5cautkc431bz5gu7 X-Rspam-User: Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=none; spf=none (imf04.hostedemail.com: domain of macro@orcam.me.uk has no SPF policy when checking 78.133.224.34) smtp.mailfrom=macro@orcam.me.uk X-Rspamd-Server: rspam03 X-HE-Tag: 1646694571-760792 X-Bogosity: Ham, tests=bogofilter, spamicity=0.001195, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, 8 Mar 2022, Mike Rapoport wrote: > > So can I just limit amount of memory without interfering with normal > > memory detection ? > > Maybe it's better to add a new encoding to mem= that will have the semantics > of limiting amount of memory? > > E.g. > > mem=384M@ > > would mean "only use 384M of memory that firmware reported" while > > mem=384M would mean "set memory to 0 - 384M" as it does now. I think you're going in the right direction, we'd just need to sort out the most reasonable syntax for the new semantics; `mem=384M@' just seems too analogous to me to `mem=384M@0'. Maybe `mem=384M-'? NB that would have to work with the existing overrides, for e.g.: `mem=192M@0 mem=192M@256M mem=384M-' to produce the following memory ranges available for use: Normal [mem 0x0000000000000000-0x000000000bffffff] Normal [mem 0x0000000010000000-0x0000000017ffffff] (so that you can paste the final cap at some command prompt and still have earlier parameters respected that may have been passed by the firmware or bootloader, or built in). Maciej