2005-09-15 08:51:28

by Srivatsa Vaddagiri

[permalink] [raw]
Subject: [PATCH 2/3] NO_IDLE_HZ support patches - add_timer_on needs a check

add_timer_on needs to check if the target CPU was sleeping. If
so it should wakeup the CPU.

Patch below is against 2.6.14-rc1.


Signed-off-by : Srivatsa Vaddagiri <[email protected]>

---

linux-2.6.14-rc1-root/kernel/timer.c | 5 +++++
1 files changed, 5 insertions(+)

diff -puN kernel/timer.c~add_timer_on kernel/timer.c
--- linux-2.6.14-rc1/kernel/timer.c~add_timer_on 2005-09-15 12:48:47.000000000 +0530
+++ linux-2.6.14-rc1-root/kernel/timer.c 2005-09-15 13:33:34.000000000 +0530
@@ -290,6 +290,11 @@ void add_timer_on(struct timer_list *tim
timer->base = &base->t_base;
internal_add_timer(base, timer);
spin_unlock_irqrestore(&base->t_base.lock, flags);
+#ifdef CONFIG_NO_IDLE_HZ
+ /* Wake up any sleeping CPU */
+ if (cpu_isset(cpu, nohz_cpu_mask))
+ smp_send_reschedule(cpu);
+#endif
}



_
--


Thanks and Regards,
Srivatsa Vaddagiri,
Linux Technology Center,
IBM Software Labs,
Bangalore, INDIA - 560017