Patch "memblock: fix crash when reserved memory is not added to memory" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    memblock: fix crash when reserved memory is not added to memory

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     memblock-fix-crash-when-reserved-memory-is-not-added.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 548c6b8dedd3de887ef55bb31425eaa488b3238d
Author: Yajun Deng <yajun.deng@xxxxxxxxx>
Date:   Thu Jan 18 14:18:53 2024 +0800

    memblock: fix crash when reserved memory is not added to memory
    
    [ Upstream commit 6a9531c3a88096a26cf3ac582f7ec44f94a7dcb2 ]
    
    After commit 61167ad5fecd ("mm: pass nid to reserve_bootmem_region()")
    nid of a reserved region is used by init_reserved_page() (with
    CONFIG_DEFERRED_STRUCT_PAGE_INIT=y) to access node strucure.
    In many cases the nid of the reserved memory is not set and this causes
    a crash.
    
    When the nid of a reserved region is not set, fall back to
    early_pfn_to_nid(), so that nid of the first_online_node will be passed
    to init_reserved_page().
    
    Fixes: 61167ad5fecd ("mm: pass nid to reserve_bootmem_region()")
    Signed-off-by: Yajun Deng <yajun.deng@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20240118061853.2652295-1-yajun.deng@xxxxxxxxx
    [rppt: massaged the commit message]
    Signed-off-by: Mike Rapoport (IBM) <rppt@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/mm/memblock.c b/mm/memblock.c
index 913b2520a9a0..6d18485571b4 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -2119,6 +2119,9 @@ static void __init memmap_init_reserved_pages(void)
 		start = region->base;
 		end = start + region->size;
 
+		if (nid == NUMA_NO_NODE || nid >= MAX_NUMNODES)
+			nid = early_pfn_to_nid(PFN_DOWN(start));
+
 		reserve_bootmem_region(start, end, nid);
 	}
 }




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux