• David Hildenbrand's avatar
    mm/memory_hotplug: inline __offline_pages() into offline_pages() · 73a11c96
    David Hildenbrand authored
    Patch series "mm/memory_hotplug: online_pages()/offline_pages() cleanups", v2.
    
    These are a bunch of cleanups for online_pages()/offline_pages() and
    related code, mostly getting rid of memory hole handling that is no longer
    necessary.  There is only a single walk_system_ram_range() call left in
    offline_pages(), to make sure we don't have any memory holes.  I had some
    of these patches lying around for a longer time but didn't have time to
    polish them.
    
    In addition, the last patch marks all pageblocks of memory to get onlined
    MIGRATE_ISOLATE, so pages that have just been exposed to the buddy cannot
    get allocated before onlining is complete.  Once heavy lifting is done,
    the pageblocks are set to MIGRATE_MOVABLE, such that allocations are
    possible.
    
    I played with DIMMs and virtio-mem on x86-64 and didn't spot any
    surprises.  I verified that the numer of isolated pageblocks is correctly
    handled when onlining/offlining.
    
    This patch (of 10):
    
    There is only a single user, offline_pages(). Let's inline, to make
    it look more similar to online_pages().
    Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Reviewed-by: default avatarOscar Salvador <osalvador@suse.de>
    Reviewed-by: default avatarPankaj Gupta <pankaj.gupta.linux@gmail.com>
    Acked-by: default avatarMichal Hocko <mhocko@suse.com>
    Cc: Wei Yang <richard.weiyang@linux.alibaba.com>
    Cc: Baoquan He <bhe@redhat.com>
    Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
    Cc: Charan Teja Reddy <charante@codeaurora.org>
    Cc: Dan Williams <dan.j.williams@intel.com>
    Cc: Fenghua Yu <fenghua.yu@intel.com>
    Cc: Logan Gunthorpe <logang@deltatee.com>
    Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
    Cc: Mel Gorman <mgorman@techsingularity.net>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: Michel Lespinasse <walken@google.com>
    Cc: Mike Rapoport <rppt@kernel.org>
    Cc: Tony Luck <tony.luck@intel.com>
    Cc: Mel Gorman <mgorman@suse.de>
    Link: https://lkml.kernel.org/r/20200819175957.28465-1-david@redhat.com
    Link: https://lkml.kernel.org/r/20200819175957.28465-2-david@redhat.comSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    73a11c96
memory_hotplug.c 49.9 KB