windfarm got signal
Hey,
after cpu hotplug I decided to write some fake suspend routines for ppc64 that always fail to see what all the drivers would say... The first thing I saw was during the phase where all threads are stopped, that windfarm got a signal!
Shortly after that, the fans were revved up fully but I guess that's expected if the wf control loop exits.
So now I'm trying to see *why* it got a signal there. Any ideas? Is that expected with pm and windfarm just does the wrong thing there by taking the signal as a reason to exit the control thread?
[code in question is windfarm_core.c:wf_thread_func]
johannes
Quoted 7 lines · Johannes Berg
Hey,
after cpu hotplug I decided to write some fake suspend routines for ppc64 that always fail to see what all the drivers would say... The first thing I saw was during the phase where all threads are stopped, that windfarm got a signal!
Quoted 8 lines
Shortly after that, the fans were revved up fully but I guess that's expected if the wf control loop exits.
So now I'm trying to see *why* it got a signal there. Any ideas? Is that expected with pm and windfarm just does the wrong thing there by taking the signal as a reason to exit the control thread?
[code in question is windfarm_core.c:wf_thread_func]
I think it's the way the freezer works ... it sends a pseudo signal to all kernel threads who are then supposed to do something like test for PF_FREEZE or something like that.
Ben.
Quoted 15 lines · Benjamin Herrenschmidt
Quoted 14 lines · Johannes Berg
Hey,
after cpu hotplug I decided to write some fake suspend routines for ppc64 that always fail to see what all the drivers would say... The first thing I saw was during the phase where all threads are stopped, that windfarm got a signal!
Shortly after that, the fans were revved up fully but I guess that's expected if the wf control loop exits.
So now I'm trying to see *why* it got a signal there. Any ideas? Is that expected with pm and windfarm just does the wrong thing there by taking the signal as a reason to exit the control thread?
Quoted 5 lines
Quoted 1 line
[code in question is windfarm_core.c:wf_thread_func]
I think it's the way the freezer works ... it sends a pseudo signal to all kernel threads who are then supposed to do something like test for
PF_FREEZEor something like that.
Yes. More precisely, they are supposed to use try_to_freeze().
Please see Documentation/power/kernel_threads.txt.
Greetings,
Rafael
Quoted 7 lines · Rafael J. Wysocki
Quoted 3 lines
I think it's the way the freezer works ... it sends a pseudo signal to all kernel threads who are then supposed to do something like test for
PF_FREEZEor something like that.Yes. More precisely, they are supposed to use
try_to_freeze().Please see
Documentation/power/kernel_threads.txt.
Thanks, I'll look and submit a patch. It does try_to_freeze() but also checks for pending signals.
johannes
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev
Quoted 2 lines · Johannes Berg
Thanks, I'll look and submit a patch. It does
try_to_freeze()but also checks for pending signals.
Ah. The code is just in the wrong order:
while (!kthread_should_stop()) {
try_to_freeze();
...
schedule_timeout_interruptible(...);
if (signal_pending())
break; }
Would it be correct to just move the try_to_freeze() before the signal_pending() statement?
johannes
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev
Hi.
Quoted 10 lines · Johannes Berg
Quoted 2 lines · Johannes Berg
Thanks, I'll look and submit a patch. It does
try_to_freeze()but also checks for pending signals.Ah. The code is just in the wrong order:
while (!kthread_should_stop()) {
try_to_freeze();
...
schedule_timeout_interruptible(...);
if (signal_pending())
Quoted 5 lines
break; }Would it be correct to just move the
try_to_freeze()before thesignal_pending()statement?
Hmm. Will kthread_should_stop() be set if it should really exit? If so, perhaps you can just remove the signal_pending() check. Otherwise, you'd want to change the signal_pending() test to something like the "if (signal_pending() && !try_to_freeze())" to avoid any possibility of a race. (In this case, you should be able to remove the try_to_freeze() from above).
Regards,
Nigel
Signature · 4 lines
Nigel, Michelle and Alisdair Cunningham 5 Mitchell Street Cobden 3266 Victoria, Australia
Quoted 6 lines · Johannes Berg
Quoted 2 lines · Johannes Berg
Thanks, I'll look and submit a patch. It does
try_to_freeze()but also checks for pending signals.Ah. The code is just in the wrong order:
The code should be
while (!kthread_should_stop()) {
try_to_freeze();
...
schedule_timeout_interruptible(...);
}
That is, I think we just don't care about the signal stuff.
Care to do a new patch ?
Cheers,
Ben.
PATCH 1/1 fix windfarm core thread wrt. signal handling
This patch removes the signal_pending() from the windfarm core thread loop as it isn't necessary and messes up when there actually *is* a signal pending because we should enter the freezer.
drivers/macintosh/windfarm_core.c +0 -6
@@ -116,12 +116,6 @@ static int wf_thread_func(void *data) delay = next - jiffies;if (delay <=HZ )schedule_timeout_interruptible (delay); - -/* there should be no signal, but oh well */ -if (signal_pending (current)) { -printk (KERN_WARNING "windfarm: thread got sigl !\n" ); -break ; - } }DBG ("wf: thread stopped\n" );
Re: [PATCH] fix windfarm core thread wrt. signal handling
Quoted 5 lines · Johannes Berg
This patch removes the
signal_pending()from the windfarm core thread loop as it isn't necessary and messes up when there actually *is* a signal pending because we should enter the freezer.Signed-off-by Johannes Berg <[email protected]>
Quoted 18 lines
drivers/macintosh/windfarm_core.c +0
-6@@ -116,12 +116,6 @@ static int wf_thread_func(void *data) delay = next - jiffies;if (delay <=HZ )schedule_timeout_interruptible (delay); - -/* there should be no signal, but oh well */ -if (signal_pending (current)) { -printk (KERN_WARNING "windfarm: thread got sigl !\n" ); -break ; - } }DBG ("wf: thread stopped\n" );
Hi!
Quoted 5 lines
after cpu hotplug I decided to write some fake suspend routines for ppc64 that always fail to see what all the drivers would say... The first thing I saw was during the phase where all threads are stopped, that windfarm got a signal!
Quoted 8 lines
Shortly after that, the fans were revved up fully but I guess that's expected if the wf control loop exits.
So now I'm trying to see *why* it got a signal there. Any ideas? Is that expected with pm and windfarm just does the wrong thing there by taking the signal as a reason to exit the control thread?
[code in question is windfarm_core.c:wf_thread_func]
See kernel/power/process.c
Signature · 1 line
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms
PATCH 1/1 windfarm: proper try_to_freeze / signal_pending handling
In reply to Johannes BergThis seems to work for me:
---
This patch makes windfarm handle signal_pending()/try_to_freeze() better.
drivers/macintosh/windfarm_core.c +2 -4
@@ -93,8 +93,6 @@ static int wf_thread_func(void *data)DBG ("wf: thread started\n" );while (!kthread_should_stop ()) { -try_to_freeze (); -if (time_after_eq (jiffies, next)) {wf_notify (WF_EVENT_TICK ,NULL );if (wf_overtemp) {
@@ -117,8 +115,8 @@ static int wf_thread_func(void *data)if (delay <=HZ )schedule_timeout_interruptible (delay); -/* there should be no signal, but oh well */ -if (signal_pending (current)) { +/* there should be no non-suspend signal, but oh well */ +if (signal_pending (current) && !try_to_freeze ()) {printk (KERN_WARNING "windfarm: thread got sigl !\n" );break ; }