Re: [PATCH v2 7/8] mm/memory_hotplug: Make unregister_memory_block_under_nodes() never fail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: David Hildenbrand <david@xxxxxxxxxx>
- Subject: Re: [PATCH v2 7/8] mm/memory_hotplug: Make unregister_memory_block_under_nodes() never fail
- From: Dan Williams <dan.j.williams@xxxxxxxxx>
- Date: Wed, 8 May 2019 06:50:25 -0700
- Cc: Linux MM <linux-mm@xxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, linux-ia64@xxxxxxxxxxxxxxx, linuxppc-dev <linuxppc-dev@xxxxxxxxxxxxxxxx>, linux-s390 <linux-s390@xxxxxxxxxxxxxxx>, Linux-sh <linux-sh@xxxxxxxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, "Rafael J. Wysocki" <rafael@xxxxxxxxxx>, Alex Deucher <alexander.deucher@xxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Mark Brown <broonie@xxxxxxxxxx>, Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>, Oscar Salvador <osalvador@xxxxxxx>, Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
- In-reply-to: <1d369ae4-7183-b455-646a-65bbbe697281@redhat.com>
- References: <20190507183804.5512-1-david@redhat.com> <20190507183804.5512-8-david@redhat.com> <CAPcyv4h2PgzQZrD0UU=4Qz_yH2C_hiYQyqV9U7CCkjpmHZ5xjQ@mail.gmail.com> <1d369ae4-7183-b455-646a-65bbbe697281@redhat.com>
On Wed, May 8, 2019 at 12:22 AM David Hildenbrand <david@xxxxxxxxxx> wrote:
>
>
> >> 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);
>
> That would require to make the mutex non-static. Is that what you
> suggest, or any other alternative?
If the concern is other code paths taking the lock when they shouldn't
then you could make a public "lockdep_assert_mem_sysfs_held()" to do
the same, but I otherwise think the benefit of inline lock validation
is worth the price of adding a new non-static symbol.
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]