* [PATCH] ACPI/Processor: Add CPU_STARTING_FROZEN check in the acpi_cpu_soft_notify()
@ 2014-07-31 9:20 Lan Tianyu
2014-07-31 21:20 ` Rafael J. Wysocki
0 siblings, 1 reply; 6+ messages in thread
From: Lan Tianyu @ 2014-07-31 9:20 UTC (permalink / raw)
To: rjw, lenb; +Cc: Lan Tianyu, linux-acpi, linux-kernel
The callback of CPU_STARTING event can't sleep and so acpi_cpu_soft_notify()
return directly when CPU_STARTING event is triggered. But cpu hotplug also
happens during S2RAM. The action will become CPU_STARTING_FROZEN. This
patch is to fix missing check the frozen event.
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
---
drivers/acpi/processor_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index 4fcbd67..66e2249 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -125,7 +125,7 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb,
* CPU_STARTING and CPU_DYING must not sleep. Return here since
* acpi_bus_get_device() may sleep.
*/
- if (action == CPU_STARTING || action == CPU_DYING)
+ if ((action & ~CPU_TASKS_FROZEN) == CPU_STARTING || action == CPU_DYING)
return NOTIFY_DONE;
if (!pr || acpi_bus_get_device(pr->handle, &device))
--
1.8.4.rc0.1.g8f6a3e5.dirty
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] ACPI/Processor: Add CPU_STARTING_FROZEN check in the acpi_cpu_soft_notify()
2014-07-31 9:20 [PATCH] ACPI/Processor: Add CPU_STARTING_FROZEN check in the acpi_cpu_soft_notify() Lan Tianyu
@ 2014-07-31 21:20 ` Rafael J. Wysocki
2014-08-01 2:51 ` Lan Tianyu
0 siblings, 1 reply; 6+ messages in thread
From: Rafael J. Wysocki @ 2014-07-31 21:20 UTC (permalink / raw)
To: Lan Tianyu; +Cc: lenb, linux-acpi, linux-kernel, Chen, Gong
On Thursday, July 31, 2014 05:20:26 PM Lan Tianyu wrote:
> The callback of CPU_STARTING event can't sleep and so acpi_cpu_soft_notify()
> return directly when CPU_STARTING event is triggered. But cpu hotplug also
> happens during S2RAM. The action will become CPU_STARTING_FROZEN. This
> patch is to fix missing check the frozen event.
>
> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
There is work to restructure the handling of CPU_TASKS_FROZEN under way
and Chen Gong is driving it. That's likely to conflict with the last
two patches from you. Can you pleaes coordinate with Gong?
Rafael
> ---
> drivers/acpi/processor_driver.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
> index 4fcbd67..66e2249 100644
> --- a/drivers/acpi/processor_driver.c
> +++ b/drivers/acpi/processor_driver.c
> @@ -125,7 +125,7 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb,
> * CPU_STARTING and CPU_DYING must not sleep. Return here since
> * acpi_bus_get_device() may sleep.
> */
> - if (action == CPU_STARTING || action == CPU_DYING)
> + if ((action & ~CPU_TASKS_FROZEN) == CPU_STARTING || action == CPU_DYING)
> return NOTIFY_DONE;
>
> if (!pr || acpi_bus_get_device(pr->handle, &device))
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ACPI/Processor: Add CPU_STARTING_FROZEN check in the acpi_cpu_soft_notify()
2014-07-31 21:20 ` Rafael J. Wysocki
@ 2014-08-01 2:51 ` Lan Tianyu
2014-08-06 1:30 ` Rafael J. Wysocki
0 siblings, 1 reply; 6+ messages in thread
From: Lan Tianyu @ 2014-08-01 2:51 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: lenb, linux-acpi, linux-kernel, Chen, Gong
On 2014年08月01日 05:20, Rafael J. Wysocki wrote:
> On Thursday, July 31, 2014 05:20:26 PM Lan Tianyu wrote:
>> The callback of CPU_STARTING event can't sleep and so acpi_cpu_soft_notify()
>> return directly when CPU_STARTING event is triggered. But cpu hotplug also
>> happens during S2RAM. The action will become CPU_STARTING_FROZEN. This
>> patch is to fix missing check the frozen event.
>>
>> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
>
> There is work to restructure the handling of CPU_TASKS_FROZEN under way
> and Chen Gong is driving it. That's likely to conflict with the last
> two patches from you. Can you please coordinate with Gong?
Hi Rafael:
Thanks for reminder. I just checked Chen Gong's patchset "Gloabl CPU
Hot-plug flag _FROZEN Clean up". There is no conflict between our
patches. Gong's patch is to remove the following macro.
CPU_ONLINE_FROZEN
CPU_UP_PREPARE_FROZEN
CPU_UP_CANCELED_FROZEN
CPU_DOWN_PREPARE_FROZEN
CPU_DOWN_FAILED_FROZEN
CPU_DEAD_FROZEN
CPU_DYING_FROZEN
CPU_STARTING_FROZEN
CPU_TASKS_FROZEN is still available and the CPU events during S2RAM
are still (CPU_xxx | CPU_TASKS_FROZEN).
BTW, this is a bug fix from my opinion and it should be backported to
stable tree.
>
> Rafael
>
>
>> ---
>> drivers/acpi/processor_driver.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
>> index 4fcbd67..66e2249 100644
>> --- a/drivers/acpi/processor_driver.c
>> +++ b/drivers/acpi/processor_driver.c
>> @@ -125,7 +125,7 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb,
>> * CPU_STARTING and CPU_DYING must not sleep. Return here since
>> * acpi_bus_get_device() may sleep.
>> */
>> - if (action == CPU_STARTING || action == CPU_DYING)
>> + if ((action & ~CPU_TASKS_FROZEN) == CPU_STARTING || action == CPU_DYING)
>> return NOTIFY_DONE;
>>
>> if (!pr || acpi_bus_get_device(pr->handle, &device))
>>
>
--
Best regards
Tianyu Lan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ACPI/Processor: Add CPU_STARTING_FROZEN check in the acpi_cpu_soft_notify()
2014-08-01 2:51 ` Lan Tianyu
@ 2014-08-06 1:30 ` Rafael J. Wysocki
2014-08-06 3:02 ` Lan Tianyu
0 siblings, 1 reply; 6+ messages in thread
From: Rafael J. Wysocki @ 2014-08-06 1:30 UTC (permalink / raw)
To: Lan Tianyu; +Cc: lenb, linux-acpi, linux-kernel, Chen, Gong
On Friday, August 01, 2014 10:51:46 AM Lan Tianyu wrote:
> On 2014年08月01日 05:20, Rafael J. Wysocki wrote:
> > On Thursday, July 31, 2014 05:20:26 PM Lan Tianyu wrote:
> >> The callback of CPU_STARTING event can't sleep and so acpi_cpu_soft_notify()
> >> return directly when CPU_STARTING event is triggered. But cpu hotplug also
> >> happens during S2RAM. The action will become CPU_STARTING_FROZEN. This
> >> patch is to fix missing check the frozen event.
OK
What's the impact of the bug you're fixing? Do we sleep when we shouldn't?
In particular, are there any bugs reported that are related to it?
> >> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
> >
> > There is work to restructure the handling of CPU_TASKS_FROZEN under way
> > and Chen Gong is driving it. That's likely to conflict with the last
> > two patches from you. Can you please coordinate with Gong?
>
> Hi Rafael:
>
> Thanks for reminder. I just checked Chen Gong's patchset "Gloabl CPU
> Hot-plug flag _FROZEN Clean up". There is no conflict between our
> patches. Gong's patch is to remove the following macro.
>
> CPU_ONLINE_FROZEN
> CPU_UP_PREPARE_FROZEN
> CPU_UP_CANCELED_FROZEN
> CPU_DOWN_PREPARE_FROZEN
> CPU_DOWN_FAILED_FROZEN
> CPU_DEAD_FROZEN
> CPU_DYING_FROZEN
> CPU_STARTING_FROZEN
>
> CPU_TASKS_FROZEN is still available and the CPU events during S2RAM
> are still (CPU_xxx | CPU_TASKS_FROZEN).
OK
> BTW, this is a bug fix from my opinion and it should be backported to
> stable tree.
We'll see.
> >> ---
> >> drivers/acpi/processor_driver.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
> >> index 4fcbd67..66e2249 100644
> >> --- a/drivers/acpi/processor_driver.c
> >> +++ b/drivers/acpi/processor_driver.c
> >> @@ -125,7 +125,7 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb,
> >> * CPU_STARTING and CPU_DYING must not sleep. Return here since
> >> * acpi_bus_get_device() may sleep.
> >> */
> >> - if (action == CPU_STARTING || action == CPU_DYING)
> >> + if ((action & ~CPU_TASKS_FROZEN) == CPU_STARTING || action == CPU_DYING)
> >> return NOTIFY_DONE;
> >>
> >> if (!pr || acpi_bus_get_device(pr->handle, &device))
> >>
> >
>
>
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ACPI/Processor: Add CPU_STARTING_FROZEN check in the acpi_cpu_soft_notify()
2014-08-06 1:30 ` Rafael J. Wysocki
@ 2014-08-06 3:02 ` Lan Tianyu
2014-08-06 19:11 ` Rafael J. Wysocki
0 siblings, 1 reply; 6+ messages in thread
From: Lan Tianyu @ 2014-08-06 3:02 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: lenb, linux-acpi, linux-kernel, Chen, Gong
On 2014年08月06日 09:30, Rafael J. Wysocki wrote:
> On Friday, August 01, 2014 10:51:46 AM Lan Tianyu wrote:
>> On 2014年08月01日 05:20, Rafael J. Wysocki wrote:
>>> On Thursday, July 31, 2014 05:20:26 PM Lan Tianyu wrote:
>>>> The callback of CPU_STARTING event can't sleep and so acpi_cpu_soft_notify()
>>>> return directly when CPU_STARTING event is triggered. But cpu hotplug also
>>>> happens during S2RAM. The action will become CPU_STARTING_FROZEN. This
>>>> patch is to fix missing check the frozen event.
>
> OK
>
> What's the impact of the bug you're fixing? Do we sleep when we shouldn't?
>
> In particular, are there any bugs reported that are related to it?
So far, there is such bug report. I found the issue when test my patch
of parallel non-boot cpu up with resuming device for S2RAM. Because
original code will wait all cpu up and then do other resume task, the
semaphore of ACPICA can always be get in the cpu notify callback and it
will not fall in the sleep. It's different situation for paralleling
non-boot cpu. The lock will be held by other threads and fall into
sleep. Further thinking, this may not cause bug in the old kernel and it
isn't needed by stable tree but the code should consider cpu frozen event.
>
>>>> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
>>>
>>> There is work to restructure the handling of CPU_TASKS_FROZEN under way
>>> and Chen Gong is driving it. That's likely to conflict with the last
>>> two patches from you. Can you please coordinate with Gong?
>>
>> Hi Rafael:
>>
>> Thanks for reminder. I just checked Chen Gong's patchset "Gloabl CPU
>> Hot-plug flag _FROZEN Clean up". There is no conflict between our
>> patches. Gong's patch is to remove the following macro.
>>
>> CPU_ONLINE_FROZEN
>> CPU_UP_PREPARE_FROZEN
>> CPU_UP_CANCELED_FROZEN
>> CPU_DOWN_PREPARE_FROZEN
>> CPU_DOWN_FAILED_FROZEN
>> CPU_DEAD_FROZEN
>> CPU_DYING_FROZEN
>> CPU_STARTING_FROZEN
>>
>> CPU_TASKS_FROZEN is still available and the CPU events during S2RAM
>> are still (CPU_xxx | CPU_TASKS_FROZEN).
>
> OK
>
>> BTW, this is a bug fix from my opinion and it should be backported to
>> stable tree.
>
> We'll see.
>
>
>>>> ---
>>>> drivers/acpi/processor_driver.c | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
>>>> index 4fcbd67..66e2249 100644
>>>> --- a/drivers/acpi/processor_driver.c
>>>> +++ b/drivers/acpi/processor_driver.c
>>>> @@ -125,7 +125,7 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb,
>>>> * CPU_STARTING and CPU_DYING must not sleep. Return here since
>>>> * acpi_bus_get_device() may sleep.
>>>> */
>>>> - if (action == CPU_STARTING || action == CPU_DYING)
>>>> + if ((action & ~CPU_TASKS_FROZEN) == CPU_STARTING || action == CPU_DYING)
>>>> return NOTIFY_DONE;
>>>>
>>>> if (!pr || acpi_bus_get_device(pr->handle, &device))
>>>>
>>>
>>
>>
>>
>
--
Best regards
Tianyu Lan
--
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ACPI/Processor: Add CPU_STARTING_FROZEN check in the acpi_cpu_soft_notify()
2014-08-06 3:02 ` Lan Tianyu
@ 2014-08-06 19:11 ` Rafael J. Wysocki
0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2014-08-06 19:11 UTC (permalink / raw)
To: Lan Tianyu; +Cc: lenb, linux-acpi, linux-kernel, Chen, Gong
On Wednesday, August 06, 2014 11:02:05 AM Lan Tianyu wrote:
> On 2014年08月06日 09:30, Rafael J. Wysocki wrote:
> > On Friday, August 01, 2014 10:51:46 AM Lan Tianyu wrote:
> >> On 2014年08月01日 05:20, Rafael J. Wysocki wrote:
> >>> On Thursday, July 31, 2014 05:20:26 PM Lan Tianyu wrote:
> >>>> The callback of CPU_STARTING event can't sleep and so acpi_cpu_soft_notify()
> >>>> return directly when CPU_STARTING event is triggered. But cpu hotplug also
> >>>> happens during S2RAM. The action will become CPU_STARTING_FROZEN. This
> >>>> patch is to fix missing check the frozen event.
> >
> > OK
> >
> > What's the impact of the bug you're fixing? Do we sleep when we shouldn't?
> >
> > In particular, are there any bugs reported that are related to it?
>
> So far, there is such bug report. I found the issue when test my patch
> of parallel non-boot cpu up with resuming device for S2RAM. Because
> original code will wait all cpu up and then do other resume task, the
> semaphore of ACPICA can always be get in the cpu notify callback and it
> will not fall in the sleep. It's different situation for paralleling
> non-boot cpu. The lock will be held by other threads and fall into
> sleep. Further thinking, this may not cause bug in the old kernel and it
> isn't needed by stable tree but the code should consider cpu frozen event.
OK, so we don't need to propagate this to -stable I'd say.
I'll queue it up for the second 3.17 pull request.
Rafael
--
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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-08-06 18:53 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-31 9:20 [PATCH] ACPI/Processor: Add CPU_STARTING_FROZEN check in the acpi_cpu_soft_notify() Lan Tianyu
2014-07-31 21:20 ` Rafael J. Wysocki
2014-08-01 2:51 ` Lan Tianyu
2014-08-06 1:30 ` Rafael J. Wysocki
2014-08-06 3:02 ` Lan Tianyu
2014-08-06 19:11 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).