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 A3C25C5478C for ; Tue, 27 Feb 2024 10:01:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0271A8000C; Tue, 27 Feb 2024 05:01:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EF162940008; Tue, 27 Feb 2024 05:01:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DBA3B8000C; Tue, 27 Feb 2024 05:01:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id C9973940008 for ; Tue, 27 Feb 2024 05:01:32 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 9BC1C160AC0 for ; Tue, 27 Feb 2024 10:01:32 +0000 (UTC) X-FDA: 81837141624.09.04BDE43 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf03.hostedemail.com (Postfix) with ESMTP id 351EC2001C for ; Tue, 27 Feb 2024 10:01:29 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=KDJnUn2p; spf=pass (imf03.hostedemail.com: domain of rppt@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709028090; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=byrTPK82Yi8BZJV+Sot7HpuUWGLNYnmSgSdIqmO7bv8=; b=kE4p9JK7qeRTzBJnTOlTNHuOAsCc3HyLGv0MoWFeY9M7tWQyR7FJDsCWmurMxILf+rkPB6 recLubCwH7+lofwJxcFd2kKkF8WjR98r3lyBZc5c3+5dUxGwVSzco7UzW+H9HrIwePpcDx RLxruRMS8rWyR7dfoPiu+Ae7poufb10= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709028091; a=rsa-sha256; cv=none; b=NBlci4TErg3MRymDAYMkVcxf1coo6fiFMcc4530HpOoWOYC3tfGlZEZbjVnzKpjb4xdxfa 7Q7f11aAJrQmpjNT0eRm+RGGpi64qZT3bWpGWmnJ4Dhqf5Ww2FvGThd8OLw9pypDGi0+st ZS9OMa3bjEOJG/6ekgm6mFt3waMxmwM= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=KDJnUn2p; spf=pass (imf03.hostedemail.com: domain of rppt@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id C1AA7CE1B25; Tue, 27 Feb 2024 10:01:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3533C433C7; Tue, 27 Feb 2024 10:01:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709028086; bh=t+Z8nkmnyZJiKo/g3DXuSPfon4RTeiLy3dhfd9t83Ik=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KDJnUn2pu3CFVygPe9YqcwwYE9Py4DJP18zijdBQwwowz2wBPtV7l4/m8HPkkUr2M TV0wCGjoK4B3p8E5PPXHCv93VORXwFrr2kEFM+yqIbmnRV5vumY6UrbLDRN2s3DzRw zJhsr/cOi3QcjZUSyrrES1oNF43vlrjgvDR9AeHGGJHv72tzTVuilOwlVhYlrscNOs 2DKBvdgqe0AQL8nrcuj7t1ZKOv/scxtYuDI8pvWgWRLY/VefMYOJuCvT606rb8UWV8 0TZuyDKzNTIZfB7wRYe5chFSVdIlFNOIMfJrocvHSKWiqhhGCduH6vKtQbeh5hySx1 bGYEF+WXNnTkg== Date: Tue, 27 Feb 2024 12:00:40 +0200 From: Mike Rapoport To: "Aiqun Yu (Maria)" Cc: Dmitry Baryshkov , Vijayanand Jitta , karahmed@amazon.de, qperret@google.com, robh@kernel.org, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, frowand.list@gmail.com, devicetree@vger.kernel.org Subject: Re: [PATCH] mm: memblock: avoid to create memmap for memblock nomap regions Message-ID: References: <42f28e7b-c001-7d01-1eb6-fe963491898e@quicinc.com> <22aca197-8d18-2c9e-b3c4-f6fdc893ceb1@quicinc.com> <76cb3b37-5887-404f-95b7-10a22a7ba65b@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 351EC2001C X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: ukndz7bbeiajatxj4cpp88ru9o451yd4 X-HE-Tag: 1709028089-854533 X-HE-Meta: U2FsdGVkX196tRxPaAEhoYJH11+6Jpsa4Z7AVW3bjsv+8LaFisfI6e5CWPRabWE8z56Ivm96lLpG8sfbhB41aVDJq/ILD/YHfpSHu70pLCbsx18Yhoi/EDFzwWGZh15qpas+GlZIAs34xl1gLFxOkPOOsqPib5uyx+UZKpng+jkKFcso+u5AkJHDJYj7UBsowdbKH8lrX0ajfDz00l80kn0OLJ8TBhsBaYfd2sceFdH88xq+oMkwF6jPKzjdZv8+Hkro5pADSg+ncQXalA1wXASOPvPEynJ9DFVsw8NPxHck6+7frRgTvesOWIu++IXdsEpi+wUXr03/Ygb2PNPPRfD61td3JTgUiX+paMS3pAvfAMlh28wxQs/JMPTkUSD6nT+kfMfKRSJ/TyattAx/uwGQqIdU+OKntaXcvozGvJPMvhVdS0o0y37G5FNGfZJ4erpfxeeGbvhL4deCow4v3qerC8D0FaKljZLpVuQQXMkrheIywlq+8cqY4U/LZL1+6uMrOViD+lhdouYIY8QpogWNpJ1QT+GwDF5XGRIfJFakdFU1rNZLgwEUZ6qiXqSen6y942WkEmDoSSI2zrM+fmqdz6cLkvC9Q3K0EYa/6ENMNAk21bNHhfZWBCE9uHZ5CyumZSMzRf7H+WvAt6pWrzI86woIWfZCWifWk3HxKN14iK3aeRm++UcMYzzRvLb8oO6ZSigKfXuSseThgxKruifEqEZgg+LLOes8e1qizQeM7V6QS5uNoEa0YtATyw9yiwykjdcD1ShXn2hylrYByDzDan3WkWR4Cueu125cVcSgV+6FuGlMdWVIcz3PPyKYH4mjAp9TrVV+hCoIEN7CW+hLGDVRrL0D+zGR2iCx8jQxU/7N7eMtSxv6ys2OkbpJmxALe1Zi0X8IbqrkC2J6RnNXGFZF7P5YbH7tR3+zIyO6GEQmPsCH2tvhZ/AjjI6/SfZgCQLpsTLAmIvSx0P Z0Q== 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: List-Subscribe: List-Unsubscribe: On Tue, Feb 20, 2024 at 02:28:32PM +0800, Aiqun Yu (Maria) wrote: > > > > > Hi Mike, > > > > > > > > > > We've put effort on bootloader side to implement the similar suggestion of > > > > > os bootloader to convey the reserved memory by omit the hole from > > > > > /memory@0{reg=[]} directly. > > > > > While there is a concern from device tree spec perspective, link [1]: "A > > > > > memory device node is required for all devicetrees and describes the > > > > > physical memory layout for the system. " > > > > > Do you have any idea on this pls? > > > > > > > > I'm not sure I understand your concern. Isn't there a /memory node that > > > > describes the memory available to Linux in your devicetree? > > > > > > That was the question. It looks like your opinion on /memory was that > > > it describes "memory available to Linux", while device tree spec > > > defines it as "physical memory layout". > > > > > I suggested a workaround that will allow to save memory map for the > > carveout. > > The memory map is a run time description of the physical memory layout and > > core mm relies on availability of struct page for every physical frame. > > Having only partial memory map will lead to subtle bugs and crashes, so > > it's not an option. > > Any idea of a formal solution for this case? > It is a real use case for the commercial device. Memory saving is always a > good topic for commercial devices. So for a total 128MB memory, ~60MB for > kernel total available memory, and ~1M free memory saving is important from > OEM point of view. > > There are 3 types of memory: > 1. used by firmware and not available to kernel at any time. > Either struct page can be avoided by kernel. Or bootloader not pass this > part of physical memory was discussed here. > Any good ideas? As I said, struct page must exist for all physical memory known to kernel. If hiding the memory that is not available to kernel does not work for you I don't have other ideas. > 2. shared by firmware/subsystem, and can be read/write access by kernel. > Just as it is now. Struct page can be allocated inside kernel and also > reserved memory for this. > 3. freely used by kernel. > Just as it is now. -- Sincerely yours, Mike.