[PATCH 18/21] ppc64/rtasd: replace schedule_timeout() with msleep()
Nishanth Aravamudan
nacc at us.ibm.com
Tue Jan 18 11:18:19 EST 2005
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 at 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);
More information about the Linuxppc64-dev
mailing list