Skip to contentSkip to conversation

kernel/smp: replace schedule_timeout() with

PATCH Pavel Machek 1 participant 1 message Jan 21, 2005 Kernel janitors

lore
Share & tools
lore
#0 lore raw

Hi!

Quoted 5 lines

Please consider applying.

Description: 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.

Actually, better question is "is it really required"? Is set_cpus_allowed guaranteed to return on right cpu already? Or perhaps schedule() is enough to guarantee this?

[I do not have smp system near me.]
Pavel

Quoted 21 lines
kernel/power/smp.c +2 -2
@@ -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);
Signature · 2 lines
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors