[PATCH v3 10/11] mm/memory_hotplug: Make unregister_memory_block_under_nodes() never fail

Oscar Salvador osalvador at suse.de
Tue Jun 11 02:56:43 AEST 2019


On Mon, May 27, 2019 at 01:11:51PM +0200, David Hildenbrand wrote:
> We really don't want anything during memory hotunplug to fail.
> We always pass a valid memory block device, that check can go. Avoid
> allocating memory and eventually failing. As we are always called under
> lock, we can use a static piece of memory. This avoids having to put
> the structure onto the stack, having to guess about the stack size
> of callers.
> 
> Patch inspired by a patch from Oscar Salvador.
> 
> In the future, there might be no need to iterate over nodes at all.
> mem->nid should tell us exactly what to remove. Memory block devices
> with mixed nodes (added during boot) should properly fenced off and never
> removed.
> 
> Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
> Cc: "Rafael J. Wysocki" <rafael at kernel.org>
> Cc: Alex Deucher <alexander.deucher at amd.com>
> Cc: "David S. Miller" <davem at davemloft.net>
> Cc: Mark Brown <broonie at kernel.org>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: David Hildenbrand <david at redhat.com>
> Cc: Oscar Salvador <osalvador at suse.de>
> Cc: Andrew Morton <akpm at linux-foundation.org>
> Cc: Jonathan Cameron <Jonathan.Cameron at huawei.com>
> Signed-off-by: David Hildenbrand <david at redhat.com>

Reviewed-by: Oscar Salvador <osalvador at suse.de>

-- 
Oscar Salvador
SUSE L3


More information about the Linuxppc-dev mailing list