• David Hildenbrand's avatar
    mm/memory_hotplug: shrink zones when offlining memory · 86834898
    David Hildenbrand authored
    commit feee6b29 upstream.
    
    -- snip --
    
    - Missing arm64 hot(un)plug support
    - Missing some vmem_altmap_offset() cleanups
    - Missing sub-section hotadd support
    - Missing unification of mm/hmm.c and kernel/memremap.c
    
    -- snip --
    
    We currently try to shrink a single zone when removing memory.  We use
    the zone of the first page of the memory we are removing.  If that
    memmap was never initialized (e.g., memory was never onlined), we will
    read garbage and can trigger kernel BUGs (due to a stale pointer):
    
        BUG: unable to handle page fault for address: 000000000000353d
        #PF: supervisor write access in kernel mode
        #PF: error_code(0x0002) - not-present page
        PGD 0 P4D 0
        Oops: 0002 [#1] SMP PTI
        CPU: 1 PID: 7 Comm: kworker/u8:0 Not tainted 5.3.0-rc5-next-20190820+ #317
        Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.4
        Workqueue: kacpi_hotplug acpi_hotpl...
    86834898
memremap.c 11.1 KB