]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
Merge tag 'memblock-v6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 18 Jul 2024 21:48:11 +0000 (14:48 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 18 Jul 2024 21:48:11 +0000 (14:48 -0700)
Pull memblock updates from Mike Rapoport:

 - 'reserve_mem' command line parameter to allow creation of named
   memory reservation at boot time.

   The driving use-case is to improve the ability of pstore to retain
   ramoops data across reboots.

 - cleanups and small improvements in memblock and mm_init

 - new tests cases in memblock test suite

* tag 'memblock-v6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock:
  memblock tests: fix implicit declaration of function 'numa_valid_node'
  memblock: Move late alloc warning down to phys alloc
  pstore/ramoops: Add ramoops.mem_name= command line option
  mm/memblock: Add "reserve_mem" to reserved named memory at boot up
  mm/mm_init.c: don't initialize page->lru again
  mm/mm_init.c: not always search next deferred_init_pfn from very beginning
  mm/mm_init.c: use deferred_init_mem_pfn_range_in_zone() to decide loop condition
  mm/mm_init.c: get the highest zone directly
  mm/mm_init.c: move nr_initialised reset down a bit
  mm/memblock: fix a typo in description of for_each_mem_region()
  mm/mm_init.c: use memblock_region_memory_base_pfn() to get startpfn
  mm/memblock: use PAGE_ALIGN_DOWN to get pgend in free_memmap
  mm/memblock: return true directly on finding overlap region
  memblock tests: add memblock_overlaps_region_checks
  mm/memblock: fix comment for memblock_isolate_range()
  memblock tests: add memblock_reserve_many_may_conflict_check()
  memblock tests: add memblock_reserve_all_locations_check()
  mm/memblock: remove empty dummy entry

1  2 
Documentation/admin-guide/kernel-parameters.txt
include/linux/mm.h
mm/memblock.c
mm/mm_init.c

Simple merge
diff --cc mm/memblock.c
index e81fb68f7f8887cbc0cd90a41a9efd607c623b8c,692dc551c0fde487999898b147614ecef102b307..3b9dc2d89b8a08aec17444e735ab3ef8d6fc07d7
@@@ -1441,6 -1446,20 +1439,17 @@@ phys_addr_t __init memblock_alloc_range
        enum memblock_flags flags = choose_memblock_flags();
        phys_addr_t found;
  
 -      if (WARN_ONCE(nid == MAX_NUMNODES, "Usage of MAX_NUMNODES is deprecated. Use NUMA_NO_NODE instead\n"))
 -              nid = NUMA_NO_NODE;
 -
+       /*
+        * Detect any accidental use of these APIs after slab is ready, as at
+        * this moment memblock may be deinitialized already and its
+        * internal data may be destroyed (after execution of memblock_free_all)
+        */
+       if (WARN_ON_ONCE(slab_is_available())) {
+               void *vaddr = kzalloc_node(size, GFP_NOWAIT, nid);
+               return vaddr ? virt_to_phys(vaddr) : 0;
+       }
        if (!align) {
                /* Can't use WARNs this early in boot on powerpc */
                dump_stack();
diff --cc mm/mm_init.c
Simple merge