Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1818340rbb; Tue, 27 Feb 2024 02:02:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXm3LEXYDeNp48QIRB9Ge5WaGzOBz5O6SdCKUUxeJlGnTN5GihbSH270SdB7QWPx9IzG8kht2Se3hDkF+ip9aq9w40W+l9mIjBy/OS+GA== X-Google-Smtp-Source: AGHT+IERyCnRGlSPMGCyqEBBXot7FIJ0a5/ACRk6azgLgWbKGaLhWN+9D+Rh7vRO3QiweU/hIhcn X-Received: by 2002:a05:622a:389:b0:42e:8ca5:4267 with SMTP id j9-20020a05622a038900b0042e8ca54267mr4597583qtx.9.1709028137813; Tue, 27 Feb 2024 02:02:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709028137; cv=pass; d=google.com; s=arc-20160816; b=lDdw/Vxrb1ZhqF4v1oiNtSGOZREOIPv7HFrZIX/fsl/ufZM1FgBGdQytiJnslasYiF us57eOSyuinGuTx1G3UHyJCPv3MB9Caq5iCaf1JBZOI0/udc9XbrEhYZMtocHOpTHnZ9 Z4cULOmlQhZR2ezYNrHiBMbTCLAotOLJGHR9r3YS4jmgdlNKnCd4Un9A+sgUfNrH8P0F kIpLz7rNO1rJthPrUg1C6MdjQKbELf0ugHvIjb1F6+o2XFSsgsC47++BGhx+ed/bmTp5 tNkg3u32wHQdE0JyvlSCi5W+uwk4uXssCOSLBQuTe0TVmXEH0GOJ9DdzCJ/MsxeLQX0s DpnA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=byrTPK82Yi8BZJV+Sot7HpuUWGLNYnmSgSdIqmO7bv8=; fh=MrwwX90fw4bLY3szzX2ITkp5B7HrR6dVgZjh2YKNh7k=; b=p7aT7hg5GP/4ffJIJUYeAdxHKR+SIOov2bOK9U+CeczDqB4NHCg2z5hdvp/Au6VU3u woxiHbxbWUXeTrOYqqOE81c+gNCNcJUUXU/VCcbVK8MdGRSuOq5VvwJAHUvu+dw9WDSV G3UGadpoq33g88vZSVyU4Vj3aC8aMXLHILuilRouPdVjQ83HbpQ/H5cB/R8RIiJFqirg AdIvj5mBzglDm35Ex2JAR+pt9kaJSZEJa8RIktG2GUX1RTOU44CR4oyIRven1eQzCPT7 bEWQj7BuTYRJ9IT/ZqVarVEv+yl2LuYwvYR54stP2oEO5rVKaBUPRyBd/bogeGePz7s9 iIcg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KDJnUn2p; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-82999-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82999-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id bp44-20020a05622a1bac00b0042c5f480416si7647912qtb.22.2024.02.27.02.02.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 02:02:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82999-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KDJnUn2p; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-82999-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82999-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E669E1C2275F for ; Tue, 27 Feb 2024 10:01:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 61DFB137C3A; Tue, 27 Feb 2024 10:01:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KDJnUn2p" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86622137C2A; Tue, 27 Feb 2024 10:01:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709028086; cv=none; b=ALj70woPEIXD1A3rL9HzBMlkB5opz1Vca38aesx7b6Q/VtXduK9I0ukQjqmSPKcbmYtHX2GSnu4Czdx505W9ADE7+vpLVHDUrVBa18q+xitX6+P8SMfFKYBNI0g9pOGJrqy+hEs4kIi5Uagb4ecZNgyW+oWdFuSKJgBVrwpnYPY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709028086; c=relaxed/simple; bh=t+Z8nkmnyZJiKo/g3DXuSPfon4RTeiLy3dhfd9t83Ik=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ffvx6UwV88RdA2QdnwQ6KuV2P0FXBVxBse2hn7b5rh7fOC2diLHMtAT/LePr3Z7dThTx+r1XtpaHxb0WWLlZhpoVGfxpWwZvDZMckHZJFDfShSvsylMeH0Mn5rR6LQ8ueoMwMgGZyEsBVEGM1CuhAOGIwCmYUKCLXeuysIhZ7BI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KDJnUn2p; arc=none smtp.client-ip=10.30.226.201 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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.