[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPcyv4h2PgzQZrD0UU=4Qz_yH2C_hiYQyqV9U7CCkjpmHZ5xjQ@mail.gmail.com>
Date: Tue, 7 May 2019 17:15:17 -0700
From: Dan Williams <dan.j.williams@...el.com>
To: David Hildenbrand <david@...hat.com>
Cc: Linux MM <linux-mm@...ck.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-ia64@...r.kernel.org,
linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
linux-s390 <linux-s390@...r.kernel.org>,
Linux-sh <linux-sh@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Alex Deucher <alexander.deucher@....com>,
"David S. Miller" <davem@...emloft.net>,
Mark Brown <broonie@...nel.org>,
Chris Wilson <chris@...is-wilson.co.uk>,
Oscar Salvador <osalvador@...e.de>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>
Subject: Re: [PATCH v2 7/8] mm/memory_hotplug: Make unregister_memory_block_under_nodes()
never fail
On Tue, May 7, 2019 at 11:39 AM David Hildenbrand <david@...hat.com> 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@...uxfoundation.org>
> Cc: "Rafael J. Wysocki" <rafael@...nel.org>
> Cc: Alex Deucher <alexander.deucher@....com>
> Cc: "David S. Miller" <davem@...emloft.net>
> Cc: Mark Brown <broonie@...nel.org>
> Cc: Chris Wilson <chris@...is-wilson.co.uk>
> Cc: David Hildenbrand <david@...hat.com>
> Cc: Oscar Salvador <osalvador@...e.de>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Jonathan Cameron <Jonathan.Cameron@...wei.com>
> Signed-off-by: David Hildenbrand <david@...hat.com>
> ---
> drivers/base/node.c | 18 +++++-------------
> include/linux/node.h | 5 ++---
> 2 files changed, 7 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/base/node.c b/drivers/base/node.c
> index 04fdfa99b8bc..9be88fd05147 100644
> --- a/drivers/base/node.c
> +++ b/drivers/base/node.c
> @@ -803,20 +803,14 @@ int register_mem_sect_under_node(struct memory_block *mem_blk, void *arg)
>
> /*
> * Unregister memory block device under all nodes that it spans.
> + * Has to be called with mem_sysfs_mutex held (due to unlinked_nodes).
Given this comment can bitrot relative to the implementation lets
instead add an explicit:
lockdep_assert_held(&mem_sysfs_mutex);
With that you can add:
Reviewed-by: Dan Williams <dan.j.williams@...el.com>
Powered by blists - more mailing lists