linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Faiyaz Mohammed <quic_faiyazm@quicinc.com>
To: Mike Rapoport <rppt@kernel.org>
Cc: <quic_vjitta@quicinc.com>, <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
Date: Thu, 5 May 2022 20:46:15 +0530	[thread overview]
Message-ID: <7b18bea8-b996-601d-f490-cb8aadfffa1b@quicinc.com> (raw)
In-Reply-To: <YlW2TO0O8qDHpkGW@kernel.org>


On 4/12/2022 10:56 PM, Mike Rapoport wrote:
> On Tue, Apr 12, 2022 at 12:39:32AM +0530, Faiyaz Mohammed wrote:
>> This 'commit 86588296acbf ("fdt: Properly handle "no-map" field in the
>> memory region")' is keeping the no-map regions in memblock.memory with
>> MEMBLOCK_NOMAP flag set to use no-map memory for EFI using memblock api's,
>> but during the initialization sparse_init mark all memblock.memory as
>> present using for_each_mem_pfn_range, which is creating the memmap for
>> no-map memblock regions. To avoid it skiping the memblock.memory regions
>> set with MEMBLOCK_NOMAP set and with this change we will be able to save
>> ~11MB memory for ~612MB carve out.
> The MEMBLOCK_NOMAP is very fragile and caused a lot of issues already. I
> really don't like the idea if adding more implicit assumptions about how
> NOMAP memory may or may not be used in a generic iterator function.

Sorry for delayed response.
Yes, it is possible that implicit assumption can create
misunderstanding. How about adding command line option and control the
no-map region in fdt.c driver, to decide whether to keep "no-map" region
with NOMAP flag or remove?. Something like below

--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -1180,8 +1180,10 @@ int __init __weak
early_init_dt_reserve_memory_arch(phys_addr_t base,
                 */
                if (memblock_is_region_reserved(base, size))
                        return -EBUSY;
-
-               return memblock_mark_nomap(base, size);
+               if (remove_nomap_region)
+                       return memblock_remove(base, size);
+               else
+                       return memblock_mark_nomap(base, size);
Thanks and regards,
Mohammed Faiyaz



  reply	other threads:[~2022-05-05 15:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-11 19:09 Faiyaz Mohammed
2022-04-12 17:26 ` Mike Rapoport
2022-05-05 15:16   ` Faiyaz Mohammed [this message]
2022-05-05 15:31     ` Rob Herring
2022-05-05 16:54     ` Mike Rapoport
2022-05-09 11:07       ` Faiyaz Mohammed
2022-05-09 11:42         ` Mike Rapoport
2022-08-03 10:57           ` Vijayanand Jitta
2022-08-05 19:22             ` Mike Rapoport
2024-02-08  6:37               ` Aiqun Yu (Maria)
2024-02-14  7:43                 ` Mike Rapoport
2024-02-14  8:11                   ` Dmitry Baryshkov
2024-02-14  9:15                     ` Mike Rapoport
2024-02-20  6:28                       ` Aiqun Yu (Maria)
2024-02-27 10:00                         ` Mike Rapoport

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7b18bea8-b996-601d-f490-cb8aadfffa1b@quicinc.com \
    --to=quic_faiyazm@quicinc.com \
    --cc=akpm@linux-foundation.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=karahmed@amazon.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=qperret@google.com \
    --cc=quic_vjitta@quicinc.com \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=rppt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox