lkml.org 
[lkml]   [2024]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH v2] memblock: add no-map alloc functions
    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

    \
     
     \ /
      Last update: 2024-04-28 14:53    [W:3.425 / U:0.956 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site