* [PATCH] ACPI/hotplug: Fix STARTING/DYING action in acpi_cpu_soft_notify()
@ 2014-05-08 13:58 Toshi Kani
2014-05-19 22:55 ` Rafael J. Wysocki
0 siblings, 1 reply; 3+ messages in thread
From: Toshi Kani @ 2014-05-08 13:58 UTC (permalink / raw)
To: rjw; +Cc: linux-acpi, linux-kernel, Toshi Kani
During CPU online/offline testing on a large system, one of the
processors got stuck after the message "bad: scheduling from the
idle thread!". The problem is that acpi_cpu_soft_notify() calls
acpi_bus_get_device() for all action types. CPU_STARTING and
CPU_DYING do not allow the notify handlers to sleep. However,
acpi_bus_get_device() can sleep in acpi_ut_acquire_mutex().
Change acpi_cpu_soft_notify() to return immediately for CPU_STARTING
and CPU_DYING as they have no action in this handler.
Signed-off-by: Toshi Kani <toshi.kani@hp.com>
---
drivers/acpi/processor_driver.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index 7f70f31..4fcbd67 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -121,6 +121,13 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb,
struct acpi_processor *pr = per_cpu(processors, cpu);
struct acpi_device *device;
+ /*
+ * CPU_STARTING and CPU_DYING must not sleep. Return here since
+ * acpi_bus_get_device() may sleep.
+ */
+ if (action == CPU_STARTING || action == CPU_DYING)
+ return NOTIFY_DONE;
+
if (!pr || acpi_bus_get_device(pr->handle, &device))
return NOTIFY_DONE;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ACPI/hotplug: Fix STARTING/DYING action in acpi_cpu_soft_notify()
2014-05-08 13:58 [PATCH] ACPI/hotplug: Fix STARTING/DYING action in acpi_cpu_soft_notify() Toshi Kani
@ 2014-05-19 22:55 ` Rafael J. Wysocki
2014-05-19 22:57 ` Toshi Kani
0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2014-05-19 22:55 UTC (permalink / raw)
To: Toshi Kani; +Cc: linux-acpi, linux-kernel
On Thursday, May 08, 2014 07:58:59 AM Toshi Kani wrote:
> During CPU online/offline testing on a large system, one of the
> processors got stuck after the message "bad: scheduling from the
> idle thread!". The problem is that acpi_cpu_soft_notify() calls
> acpi_bus_get_device() for all action types. CPU_STARTING and
> CPU_DYING do not allow the notify handlers to sleep. However,
> acpi_bus_get_device() can sleep in acpi_ut_acquire_mutex().
>
> Change acpi_cpu_soft_notify() to return immediately for CPU_STARTING
> and CPU_DYING as they have no action in this handler.
>
> Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Queued up for 3.16, thanks!
> ---
> drivers/acpi/processor_driver.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
> index 7f70f31..4fcbd67 100644
> --- a/drivers/acpi/processor_driver.c
> +++ b/drivers/acpi/processor_driver.c
> @@ -121,6 +121,13 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb,
> struct acpi_processor *pr = per_cpu(processors, cpu);
> struct acpi_device *device;
>
> + /*
> + * CPU_STARTING and CPU_DYING must not sleep. Return here since
> + * acpi_bus_get_device() may sleep.
> + */
> + if (action == CPU_STARTING || action == CPU_DYING)
> + return NOTIFY_DONE;
> +
> if (!pr || acpi_bus_get_device(pr->handle, &device))
> return NOTIFY_DONE;
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ACPI/hotplug: Fix STARTING/DYING action in acpi_cpu_soft_notify()
2014-05-19 22:55 ` Rafael J. Wysocki
@ 2014-05-19 22:57 ` Toshi Kani
0 siblings, 0 replies; 3+ messages in thread
From: Toshi Kani @ 2014-05-19 22:57 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: linux-acpi, linux-kernel
On Tue, 2014-05-20 at 00:55 +0200, Rafael J. Wysocki wrote:
> On Thursday, May 08, 2014 07:58:59 AM Toshi Kani wrote:
> > During CPU online/offline testing on a large system, one of the
> > processors got stuck after the message "bad: scheduling from the
> > idle thread!". The problem is that acpi_cpu_soft_notify() calls
> > acpi_bus_get_device() for all action types. CPU_STARTING and
> > CPU_DYING do not allow the notify handlers to sleep. However,
> > acpi_bus_get_device() can sleep in acpi_ut_acquire_mutex().
> >
> > Change acpi_cpu_soft_notify() to return immediately for CPU_STARTING
> > and CPU_DYING as they have no action in this handler.
> >
> > Signed-off-by: Toshi Kani <toshi.kani@hp.com>
>
> Queued up for 3.16, thanks!
Great! Thanks Rafael!
-Toshi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-05-19 23:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-08 13:58 [PATCH] ACPI/hotplug: Fix STARTING/DYING action in acpi_cpu_soft_notify() Toshi Kani
2014-05-19 22:55 ` Rafael J. Wysocki
2014-05-19 22:57 ` Toshi Kani
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox