Merge branch 'akpm' (patches from Andrew)
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 12 Mar 2019 17:39:53 +0000 (10:39 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 12 Mar 2019 17:39:53 +0000 (10:39 -0700)
Merge misc updates from Andrew Morton:

 - a few misc things

 - the rest of MM

-  remove flex_arrays, replace with new simple radix-tree implementation

* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (38 commits)
  Drop flex_arrays
  sctp: convert to genradix
  proc: commit to genradix
  generic radix trees
  selinux: convert to kvmalloc
  md: convert to kvmalloc
  openvswitch: convert to kvmalloc
  of: fix kmemleak crash caused by imbalance in early memory reservation
  mm: memblock: update comments and kernel-doc
  memblock: split checks whether a region should be skipped to a helper function
  memblock: remove memblock_{set,clear}_region_flags
  memblock: drop memblock_alloc_*_nopanic() variants
  memblock: memblock_alloc_try_nid: don't panic
  treewide: add checks for the return value of memblock_alloc*()
  swiotlb: add checks for the return value of memblock_alloc*()
  init/main: add checks for the return value of memblock_alloc*()
  mm/percpu: add checks for the return value of memblock_alloc*()
  sparc: add checks for the return value of memblock_alloc*()
  ia64: add checks for the return value of memblock_alloc*()
  arch: don't memset(0) memory returned by memblock_alloc()
  ...

1  2 
arch/x86/kernel/e820.c

diff --combined arch/x86/kernel/e820.c
index 666e4af145a25dd6be6113269259c45d6aa4a895,6831c843795104cf75cb433763f0a55f7811592c..2879e234e1936f76e59383d56ee5c26b58ce6b53
@@@ -14,7 -14,6 +14,7 @@@
  #include <linux/acpi.h>
  #include <linux/firmware-map.h>
  #include <linux/sort.h>
 +#include <linux/memory_hotplug.h>
  
  #include <asm/e820/api.h>
  #include <asm/setup.h>
@@@ -776,7 -775,7 +776,7 @@@ u64 __init e820__memblock_alloc_reserve
  {
        u64 addr;
  
-       addr = __memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ACCESSIBLE);
+       addr = memblock_phys_alloc(size, align);
        if (addr) {
                e820__range_update_kexec(addr, size, E820_TYPE_RAM, E820_TYPE_RESERVED);
                pr_info("update e820_table_kexec for e820__memblock_alloc_reserved()\n");
@@@ -879,10 -878,6 +879,10 @@@ static int __init parse_memopt(char *p
  
        e820__range_remove(mem_size, ULLONG_MAX - mem_size, E820_TYPE_RAM, 1);
  
 +#ifdef CONFIG_MEMORY_HOTPLUG
 +      max_mem_size = mem_size;
 +#endif
 +
        return 0;
  }
  early_param("mem", parse_memopt);
@@@ -1097,6 -1092,9 +1097,9 @@@ void __init e820__reserve_resources(voi
  
        res = memblock_alloc(sizeof(*res) * e820_table->nr_entries,
                             SMP_CACHE_BYTES);
+       if (!res)
+               panic("%s: Failed to allocate %zu bytes\n", __func__,
+                     sizeof(*res) * e820_table->nr_entries);
        e820_res = res;
  
        for (i = 0; i < e820_table->nr_entries; i++) {