Re: [PATCH] NOHZ, check to see if tick device is initialized in IRQhandling path
From: Thomas Gleixner
Date: Fri May 03 2013 - 09:02:56 EST
On Fri, 3 May 2013, Prarit Bhargava wrote:
> Down a cpu and then bring it back up.
Ahhhh. So the issue is, that we do not clear the per cpu ts->inidle
and friends when we bring the cpu down.
The patch below should address that.
Thanks,
tglx
Index: linux-2.6/kernel/time/tick-common.c
===================================================================
--- linux-2.6.orig/kernel/time/tick-common.c
+++ linux-2.6/kernel/time/tick-common.c
@@ -387,6 +387,7 @@ static int tick_notify(struct notifier_b
tick_shutdown_broadcast_oneshot(dev);
tick_shutdown_broadcast(dev);
tick_shutdown(dev);
+ tick_shutdown_nohz(dev);
break;
case CLOCK_EVT_NOTIFY_SUSPEND:
Index: linux-2.6/kernel/time/tick-internal.h
===================================================================
--- linux-2.6.orig/kernel/time/tick-internal.h
+++ linux-2.6/kernel/time/tick-internal.h
@@ -144,3 +144,9 @@ static inline int tick_device_is_functio
#endif
extern void do_timer(unsigned long ticks);
+
+#ifdef CONFIG_NO_HZ
+extern void tick_shutdown_nohz(unsigned int *cpup);
+#else
+static inline void tick_shutdown_nohz(unsigned int *cpup) { }
+#endif
Index: linux-2.6/kernel/time/tick-sched.c
===================================================================
--- linux-2.6.orig/kernel/time/tick-sched.c
+++ linux-2.6/kernel/time/tick-sched.c
@@ -797,6 +797,13 @@ static inline void tick_check_nohz(int c
}
}
+void tick_shutdown_nohz(unsigned int *cpup)
+{
+ struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);
+
+ memset(ts, 0, sizeof(*ts));
+}
+
#else
static inline void tick_nohz_switch_to_nohz(void) { }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/