linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: DaeRo Lee <skseofh@gmail.com>
To: Mike Rapoport <rppt@kernel.org>
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 <daero_le.lee@samsung.com>
Subject: Re: [PATCH v2] memblock: add no-map alloc functions
Date: Sun, 28 Apr 2024 21:52:42 +0900	[thread overview]
Message-ID: <CAATEi5=-oxOGqGD=xL=tjYRh5Q_xk5qLsXcTXq+4LRyOT8J6Rg@mail.gmail.com> (raw)
In-Reply-To: <Zi46Wri1mPTiEArU@kernel.org>

2024년 4월 28일 (일) 오후 9:01, Mike Rapoport <rppt@kernel.org>님이 작성:
>
> On Sun, Apr 28, 2024 at 07:36:40PM +0900, DaeRo Lee wrote:
> > 2024년 4월 28일 (일) 오후 3:35, Mike Rapoport <rppt@kernel.org>님이 작성:
> > >
> > > On Sat, Apr 27, 2024 at 07:24:23PM +0900, DaeRo Lee wrote:
> > > > 2024년 4월 27일 (토) 오후 5:50, Mike Rapoport <rppt@kernel.org>님이 작성:
> > > > > > >
> > > > > > > So, here is what I think:
> > > > > > > - reserved-memory w/ nomap region -> mark only to memblock.memory
> > > > > > > - reserved-memory w/o nomap region -> add to the memblock.reserved
> > > > >
> > > > > NOMAP and memblock.reserved are semantically different, and at makes sense
> > > > > to have a "reserved nomap" node in fdt recorded in both memblock.memory and
> > > > > memblock.reserved.
> > > > >
> > > > > memblock.reserved represents the memory that is used by firmware or early
> > > > > kernel allocation, so reserved memory in fdt should be reserved in memblock
> > > > > as well. I believe it's an oversight that early_init_dt_reserve_memory()
> > > > > does not call memblock_reserve() for nomap memory.
> > > > >
> > > > > NOMAP is a property of a memory region that says that that region should
> > > > > not be mapped in the linear map, it's not necessarily in use.
> > > >
> > > > I agree that the NOMAP region should be added to memblock.reserved.
> > > >
> > > > So, I think we need to clean-up memmap_init_reserved_pages, because in
> > > > this function we call reserve_bootmem_region for memblock.reserved and
> > > > memblock.memory with nomap. We don't need to call
> > > > reserve_bootmem_region for nomap.
> > >
> > > Read the comment about memblock_mark_nomap()
> > I read the comment about memblock_mark_nomap() and understood that
> > regions with nomap flags should be treated as PageReserved.
> > But, if we add this nomap region to memblock.reserved, the region with
> > nomap flag will be processed in the first for-loop in
> > memmap_init_reserved_pages.
>
> memblock still must make sure that pages in nomap regions get PG_Reserved
> to be robust against potential errors and bugs in firmware parsing.
Got it.
Thank you for your comments. I'll make another patch for just clean-up
early_init_dt_reserve_memory()

Thank you.

Regards,
DaeRo Lee


      reply	other threads:[~2024-04-28 12:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16 12:06 skseofh
2024-04-16 12:06 ` skseofh
2024-04-17  2:23   ` Wei Yang
2024-04-17  6:02   ` Mike Rapoport
2024-04-18 14:54     ` DaeRo Lee
2024-04-18 18:03       ` Mike Rapoport
2024-04-19  1:46         ` DaeRo Lee
2024-04-19  1:59           ` DaeRo Lee
2024-04-27  2:42             ` DaeRo Lee
2024-04-27  3:27               ` DaeRo Lee
2024-04-27  8:49             ` Mike Rapoport
2024-04-27 10:24               ` DaeRo Lee
2024-04-28  6:33                 ` Mike Rapoport
2024-04-28 10:36                   ` DaeRo Lee
2024-04-28 12:00                     ` Mike Rapoport
2024-04-28 12:52                       ` DaeRo Lee [this message]

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='CAATEi5=-oxOGqGD=xL=tjYRh5Q_xk5qLsXcTXq+4LRyOT8J6Rg@mail.gmail.com' \
    --to=skseofh@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=daero_le.lee@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=robh@kernel.org \
    --cc=rppt@kernel.org \
    --cc=saravanak@google.com \
    /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