All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH 18/21] ppc64/rtasd: replace schedule_timeout() with
@ 2005-01-18  0:18 Nishanth Aravamudan
  0 siblings, 0 replies; only message in thread
From: Nishanth Aravamudan @ 2005-01-18  0:18 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1483 bytes --]

Hi,

Please consider applying. 

Description: Replace schedule_timeout() with msleep()/ssleep(). In both cases,
the current code sleeps in TASK_INTERRUPTIBLE but does not account for early
wakeups due to signals being caught; therefore I have used TASK_UNINTERRUPTIBLE
sleeps in both cases. The second sleep is slightly more difficult to convert as
rtas_event_scan_rate is variable. I have left it as a msleep() call, although
ssleep() may be more appropriate.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>

--- 2.6.11-rc1-kj-v/arch/ppc64/kernel/rtasd.c	2005-01-15 16:55:41.000000000 -0800
+++ 2.6.11-rc1-kj/arch/ppc64/kernel/rtasd.c	2005-01-15 17:28:50.000000000 -0800
@@ -19,6 +19,7 @@
 #include <linux/vmalloc.h>
 #include <linux/spinlock.h>
 #include <linux/cpu.h>
+#include <linux/delay.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -444,8 +445,7 @@ static int rtasd(void *unused)
 		DEBUG("watchdog scheduled on cpu %d\n", smp_processor_id());
 
 		do_event_scan(event_scan);
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout(HZ);
+		ssleep(1);
 	}
 	unlock_cpu_hotplug();
 
@@ -466,8 +466,7 @@ static int rtasd(void *unused)
 		 * one second since some machines have problems if we
 		 * call event-scan too quickly). */
 		unlock_cpu_hotplug();
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout((HZ*60/rtas_event_scan_rate) / 2);
+		msleep(30000/rtas_event_scan_rate);
 		lock_cpu_hotplug();
 
 		cpu = next_cpu(cpu, cpu_online_map);

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-01-18  0:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-18  0:18 [KJ] [PATCH 18/21] ppc64/rtasd: replace schedule_timeout() with Nishanth Aravamudan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.