[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0iBntT1c7gKkXG-RJpabZne2n-Afq40GKeA6-tUViVZuQ@mail.gmail.com>
Date: Thu, 25 Jul 2019 11:22:46 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Oscar Salvador <osalvador@...e.de>
Cc: David Hildenbrand <david@...hat.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux Memory Management List <linux-mm@...ck.org>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Andrew Morton <akpm@...ux-foundation.org>,
Michal Hocko <mhocko@...e.com>
Subject: Re: [PATCH v1] ACPI / scan: Acquire device_hotplug_lock in acpi_scan_init()
On Thu, Jul 25, 2019 at 11:18 AM Oscar Salvador <osalvador@...e.de> wrote:
>
> On Wed, Jul 24, 2019 at 04:30:17PM +0200, David Hildenbrand wrote:
> > We end up calling __add_memory() without the device hotplug lock held.
> > (I used a local patch to assert in __add_memory() that the
> > device_hotplug_lock is held - I might upstream that as well soon)
> >
> > [ 26.771684] create_memory_block_devices+0xa4/0x140
> > [ 26.772952] add_memory_resource+0xde/0x200
> > [ 26.773987] __add_memory+0x6e/0xa0
> > [ 26.775161] acpi_memory_device_add+0x149/0x2b0
> > [ 26.776263] acpi_bus_attach+0xf1/0x1f0
> > [ 26.777247] acpi_bus_attach+0x66/0x1f0
> > [ 26.778268] acpi_bus_attach+0x66/0x1f0
> > [ 26.779073] acpi_bus_attach+0x66/0x1f0
> > [ 26.780143] acpi_bus_scan+0x3e/0x90
> > [ 26.780844] acpi_scan_init+0x109/0x257
> > [ 26.781638] acpi_init+0x2ab/0x30d
> > [ 26.782248] do_one_initcall+0x58/0x2cf
> > [ 26.783181] kernel_init_freeable+0x1bd/0x247
> > [ 26.784345] kernel_init+0x5/0xf1
> > [ 26.785314] ret_from_fork+0x3a/0x50
> >
> > So perform the locking just like in acpi_device_hotplug().
> >
> > Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>
> > Cc: Len Brown <lenb@...nel.org
> > Cc: Andrew Morton <akpm@...ux-foundation.org>
> > Cc: Oscar Salvador <osalvador@...e.de>
> > Cc: Michal Hocko <mhocko@...e.com>
> > Signed-off-by: David Hildenbrand <david@...hat.com>
>
> Given that that call comes from a __init function, so while booting, I wonder
> how bad it is.
Yes, it probably does not matter.
> Anyway, let us be consistent:
Right.
Powered by blists - more mailing lists