[PATCH v3 07/11] mm/memory_hotplug: Create memory block devices after arch_add_memory()

Pavel Tatashin pasha.tatashin at soleen.com
Fri May 31 07:07:05 AEST 2019


On Mon, May 27, 2019 at 7:12 AM David Hildenbrand <david at redhat.com> wrote:
>
> Only memory to be added to the buddy and to be onlined/offlined by
> user space using /sys/devices/system/memory/... needs (and should have!)
> memory block devices.
>
> Factor out creation of memory block devices. Create all devices after
> arch_add_memory() succeeded. We can later drop the want_memblock parameter,
> because it is now effectively stale.
>
> Only after memory block devices have been added, memory can be onlined
> by user space. This implies, that memory is not visible to user space at
> all before arch_add_memory() succeeded.
>
> While at it
> - use WARN_ON_ONCE instead of BUG_ON in moved unregister_memory()
> - introduce find_memory_block_by_id() to search via block id
> - Use find_memory_block_by_id() in init_memory_block() to catch
>   duplicates
>
> Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
> Cc: "Rafael J. Wysocki" <rafael at kernel.org>
> Cc: David Hildenbrand <david at redhat.com>
> Cc: "mike.travis at hpe.com" <mike.travis at hpe.com>
> Cc: Andrew Morton <akpm at linux-foundation.org>
> Cc: Ingo Molnar <mingo at kernel.org>
> Cc: Andrew Banman <andrew.banman at hpe.com>
> Cc: Oscar Salvador <osalvador at suse.de>
> Cc: Michal Hocko <mhocko at suse.com>
> Cc: Pavel Tatashin <pasha.tatashin at soleen.com>
> Cc: Qian Cai <cai at lca.pw>
> Cc: Wei Yang <richard.weiyang at gmail.com>
> Cc: Arun KS <arunks at codeaurora.org>
> Cc: Mathieu Malaterre <malat at debian.org>
> Signed-off-by: David Hildenbrand <david at redhat.com>

LGTM
Reviewed-by: Pavel Tatashin <pasha.tatashin at soleen.com>


More information about the Linuxppc-dev mailing list