Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp415406lqb; Tue, 16 Apr 2024 23:03:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW7EL3VEzp/U0IvC85uifN8yNyT2rg+rtTxmfntMqplmtyI88CHAIyZmZBVg7NQB/DFAfA64aShmbTSZZAykGiROW5bhIA/qPNSsMq2Vw== X-Google-Smtp-Source: AGHT+IEfoZOrWPrPiic6Yd7IFVnqOIud5hmaoZqsgh3/gBsUja62dcD06urjAXxLh2s4ckGaE3qO X-Received: by 2002:a17:902:ea07:b0:1e0:ca47:4d96 with SMTP id s7-20020a170902ea0700b001e0ca474d96mr19824110plg.3.1713333834537; Tue, 16 Apr 2024 23:03:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713333834; cv=pass; d=google.com; s=arc-20160816; b=I4keHKg6qd+zliVvcqARI4dXngYGhO4fm+sC5sBnnVH2rU1Txeek5M7KLlzDRstdXm QMtgdTtDRfqTNtRmkZ6HRS7ToS9n1ta6xU8c0HXYLo2ThX+yx6FmQ7E1KXJsCMgEGa4r HATUeFj7IBYv6x6bLr41gLNAS8zlVy881j0/vFx8IIZHlx/3qJ9O5WwkMXC/KuIpmTY0 /vvkDB+aHHvUFFRw7J0XG7TluZWlnkI4BZs7ULErYvYE0xM3ZzStWLZIBUuYeoKNCqO1 VzWwEd80di/YYvlwM1hjE4sG6aAiu1BqaKhS6KSFU3oNWYK5OeDNk833YBjP2OOm2FRw 3o+Q== 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=tNvRQM1D/O6G4IG5CgPTTQ9b7N+I3rUWEmG85qbitPw=; fh=R2smaxBxaY+KuB2sZUT7lUIFXANQ2UYsXwsxse/98Bg=; b=iLIdzymj84O9rQYTTIU6EcfqwJLxsVgTYa4h7z7lA6dALKlfA6g/71HPWGyeX+Enzr zuC8V242Kf5EjnzX43ywxwtkC50uL7goc5i76z59XsOLH59xpHx7cduFg8TehCBiSm6f 67cdu/GXyXG2cNdGqfTFB4mRZPvDoEF9yIfB9u0LhKoRtWdR4Sa48lqg2I+qmJxexO5I zigkeBfhIKHgamF3Wxo9wyqLiSVVqenCe+HvdR+Io0GWDJwfn1hkN2IXKK5SaokHVB7Y Khg31etE/afp1/ozTnBiC7jVZupzit/iCSuAjJum/1Y2CGYk5L/84+4k9+3uqW64sIjP v9qQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r1Y1CQib; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-147973-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147973-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id k5-20020a170902d58500b001dffdf223d4si10798177plh.105.2024.04.16.23.03.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 23:03:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147973-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r1Y1CQib; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-147973-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147973-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id B1526B21AA3 for ; Wed, 17 Apr 2024 06:03:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FA6F52F7C; Wed, 17 Apr 2024 06:03:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="r1Y1CQib" 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 2B2D42209B; Wed, 17 Apr 2024 06:03:45 +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=1713333826; cv=none; b=FYUKP2so5Z79Dqs82qP1jkRQUkXbuwMKLAhRBN/MkIxxoON0NxgTtGwLXcIxgaGDW9XIzAR9SNKkmVZj5pS9N7sOOoznwx6Zj9JPnR99A0OGKzjJYLhc4ePEPIeBJkTlmJA+/7pkEkzr0rZ6i+YuLeAMbyMjKkJwpS3bM+x6v8U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713333826; c=relaxed/simple; bh=+Eq3FWKGrjqS7seNZKXEpLlxTviRiT6+OZ9xQJRqG4U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OWuhKfyxkxNJIZzYx9aduBXWAGPVVdxNPFSlakuE4CIuRtdjBlSgc9FR+T+Ii20ohH5Hsz6o3Fi167dgyahStD5rvOx4D9WVJdK8s3kcnOQIp2ks2HQodXQ+8P3JWeMAmnud272wkLnFkTBYVUCLJ5/Xh7pN99F92EPEUvr+yuo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=r1Y1CQib; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC58CC072AA; Wed, 17 Apr 2024 06:03:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713333825; bh=+Eq3FWKGrjqS7seNZKXEpLlxTviRiT6+OZ9xQJRqG4U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r1Y1CQibHTdcudeq5dwRUa2vqa/wiYnKE6l4s7SxAT9G3vk5VhpLBiKTYvFBMhJeP K8tGsbHguWZi1NE4p0IymTKorSlCRAz86GUra+tCkGeVW/LfGIzdzDm3tpePhvBjZn 4x67S+iZcpUHPVcAH03gFvPsIYznEGerpBYt+SQl4Oo/SvQCPzh8H1rwqaQgWKy+rm w5hfRMrDxD5sRn9UZW0xOhUJkkvub4lJYOd3DU4Acj4WDSaenNL2RKiWDBE9wJ5n/3 8ekXq+wxbUqdoKd7QVf8HsvFbahBuA0TUGx4KvLfXVnnMizJ75ZnDllOJpQz5O8K2A qC/e9wFfzWBQA== Date: Wed, 17 Apr 2024 09:02:36 +0300 From: Mike Rapoport To: skseofh@gmail.com Cc: robh@kernel.org, saravanak@google.com, akpm@linux-foundation.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Daero Lee Subject: Re: [PATCH v2] memblock: add no-map alloc functions Message-ID: References: <20240416120635.361838-1-skseofh@gmail.com> <20240416120635.361838-2-skseofh@gmail.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: <20240416120635.361838-2-skseofh@gmail.com> On Tue, Apr 16, 2024 at 09:06:35PM +0900, skseofh@gmail.com wrote: > From: Daero Lee > > Like reserved-memory with the 'no-map' property and only 'size' property > (w/o 'reg' property), there are memory regions need to be allocated in > memblock.memory marked with the MEMBLOCK_NOMAP flag, but should not be > allocated in memblock.reserved. This still does not explain why you need such regions. As Wei Yang explained, memblock does not allocate memory from memblock.reserved. The memblock.reserved array represents memory that is in use by firmware or by early kernel allocations and cannot be freed to page allocator. If you have a region that's _NOMAP in memblock.memory and is absent in memblock.reserved it will not be mapped by the kernel page tables, but it will be considered as free memory by the core mm. Is this really what you want? > example : arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi > reserved-memory { > #address-cells = <2>; > #size-cells = <2>; > ranges; > > bman_fbpr: bman-fbpr { > compatible = "shared-dma-pool"; > size = <0 0x1000000>; > alignment = <0 0x1000000>; > no-map; > }; > > qman_fqd: qman-fqd { > compatible = "shared-dma-pool"; > size = <0 0x400000>; > alignment = <0 0x400000>; > no-map; > }; > > qman_pfdr: qman-pfdr { > compatible = "shared-dma-pool"; > size = <0 0x2000000>; > alignment = <0 0x2000000>; > no-map; > }; > }; > -- Sincerely yours, Mike.