From: Andrew Morton Date: Tue, 5 Nov 2013 05:54:55 +0000 (+1100) Subject: kernel/time/tick-common.c: document tick_do_timer_cpu X-Git-Tag: next-20131105~2^2~323 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=69d585c225fe6dd456278703d06eb746a370cab1;p=karo-tx-linux.git kernel/time/tick-common.c: document tick_do_timer_cpu Taken straight from a tglx email ;) Cc: Thomas Gleixner Signed-off-by: Andrew Morton --- diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c index 64522ecdfe0e..162b03ab0ad2 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; /*