mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch 1/1] kernel/smp: replace schedule_timeout() with ssleep()
@ 2005-03-06 22:22 domen
  2005-03-06 22:24 ` Pavel Machek
  0 siblings, 1 reply; 2+ messages in thread
From: domen @ 2005-03-06 22:22 UTC (permalink / raw)
  To: pavel; +Cc: linux-kernel, domen, nacc




Use ssleep() instead of schedule_timeout(). The original code uses
TASK_INTERRUPTIBLE, but does not check for signals, so I believe the change to
ssleep() is appropriate.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Domen Puncer <domen@coderock.org>
---


 kj-domen/kernel/power/smp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -puN kernel/power/smp.c~ssleep-kernel_power_smp kernel/power/smp.c
--- kj/kernel/power/smp.c~ssleep-kernel_power_smp	2005-03-05 16:11:19.000000000 +0100
+++ kj-domen/kernel/power/smp.c	2005-03-05 16:11:19.000000000 +0100
@@ -13,6 +13,7 @@
 #include <linux/interrupt.h>
 #include <linux/suspend.h>
 #include <linux/module.h>
+#include <linux/delay.h>
 #include <asm/atomic.h>
 #include <asm/tlbflush.h>
 
@@ -49,8 +50,7 @@ void disable_nonboot_cpus(void)
 	printk("Freezing CPUs (at %d)", smp_processor_id());
 	oldmask = current->cpus_allowed;
 	set_cpus_allowed(current, cpumask_of_cpu(0));
-	current->state = TASK_INTERRUPTIBLE;
-	schedule_timeout(HZ);
+	ssleep(1);
 	printk("...");
 	BUG_ON(smp_processor_id() != 0);
 
_

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch 1/1] kernel/smp: replace schedule_timeout() with ssleep()
  2005-03-06 22:22 [patch 1/1] kernel/smp: replace schedule_timeout() with ssleep() domen
@ 2005-03-06 22:24 ` Pavel Machek
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Machek @ 2005-03-06 22:24 UTC (permalink / raw)
  To: domen; +Cc: linux-kernel, nacc

Hi!

> Use ssleep() instead of schedule_timeout(). The original code uses
> TASK_INTERRUPTIBLE, but does not check for signals, so I believe the change to
> ssleep() is appropriate.
> 
> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
> Signed-off-by: Domen Puncer <domen@coderock.org>

Actually this code should be rewritten to use cpu hotplug
infrastructure, but this seems simple enough. ACK. [Heh, would be nice
if someone could test it...]

							Pavel

> diff -puN kernel/power/smp.c~ssleep-kernel_power_smp kernel/power/smp.c
> --- kj/kernel/power/smp.c~ssleep-kernel_power_smp	2005-03-05 16:11:19.000000000 +0100
> +++ kj-domen/kernel/power/smp.c	2005-03-05 16:11:19.000000000 +0100
> @@ -13,6 +13,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/suspend.h>
>  #include <linux/module.h>
> +#include <linux/delay.h>
>  #include <asm/atomic.h>
>  #include <asm/tlbflush.h>
>  
> @@ -49,8 +50,7 @@ void disable_nonboot_cpus(void)
>  	printk("Freezing CPUs (at %d)", smp_processor_id());
>  	oldmask = current->cpus_allowed;
>  	set_cpus_allowed(current, cpumask_of_cpu(0));
> -	current->state = TASK_INTERRUPTIBLE;
> -	schedule_timeout(HZ);
> +	ssleep(1);
>  	printk("...");
>  	BUG_ON(smp_processor_id() != 0);
>  
> _

-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-03-06 22:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-06 22:22 [patch 1/1] kernel/smp: replace schedule_timeout() with ssleep() domen
2005-03-06 22:24 ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®