summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2013-11-15 14:15:33 -0800
committerThomas Gleixner <tglx@linutronix.de>2013-11-19 14:59:50 +0100
commit050ded1bbaea3331745cf2782315f5bc2582d083 (patch)
tree0d7005962a2611c254cec27736cb5750bea2b58c
parentda554eba2e68c8ec051977db5ee1f42d384a01ed (diff)
downloadop-kernel-dev-050ded1bbaea3331745cf2782315f5bc2582d083.zip
op-kernel-dev-050ded1bbaea3331745cf2782315f5bc2582d083.tar.gz
tick: Document tick_do_timer_cpu
Taken straight from a tglx email ;) Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--kernel/time/tick-common.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
index 64522ec..162b03a 100644
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -33,6 +33,21 @@ DEFINE_PER_CPU(struct tick_device, tick_cpu_device);
*/
ktime_t tick_next_period;
ktime_t tick_period;
+
+/*
+ * tick_do_timer_cpu is a timer core internal variable which holds the CPU NR
+ * which is responsible for calling do_timer(), i.e. the timekeeping stuff. This
+ * variable has two functions:
+ *
+ * 1) Prevent a thundering herd issue of a gazillion of CPUs trying to grab the
+ * timekeeping lock all at once. Only the CPU which is assigned to do the
+ * update is handling it.
+ *
+ * 2) Hand off the duty in the NOHZ idle case by setting the value to
+ * TICK_DO_TIMER_NONE, i.e. a non existing CPU. So the next cpu which looks
+ * at it will take over and keep the time keeping alive. The handover
+ * procedure also covers cpu hotplug.
+ */
int tick_do_timer_cpu __read_mostly = TICK_DO_TIMER_BOOT;
/*
OpenPOWER on IntegriCloud