Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clockevents: Remove the per cpu tick skew

Historically, Linux has tried to make the regular timer tick on the
various CPUs not happen at the same time, to avoid contention on
xtime_lock.

Nowadays, with the tickless kernel, this contention no longer happens
since time keeping and updating are done differently. In addition,
this skew is actually hurting power consumption in a measurable way on
many-core systems.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
LKML-Reference: <20100727210210.58d3118c@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

authored by

Arjan van de Ven and committed by
Thomas Gleixner
af5ab277 2b08de00

-5
-5
kernel/time/tick-sched.c
··· 780 780 { 781 781 struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched); 782 782 ktime_t now = ktime_get(); 783 - u64 offset; 784 783 785 784 /* 786 785 * Emulate tick processing via per-CPU hrtimers: ··· 789 790 790 791 /* Get the next period (per cpu) */ 791 792 hrtimer_set_expires(&ts->sched_timer, tick_init_jiffy_update()); 792 - offset = ktime_to_ns(tick_period) >> 1; 793 - do_div(offset, num_possible_cpus()); 794 - offset *= smp_processor_id(); 795 - hrtimer_add_expires_ns(&ts->sched_timer, offset); 796 793 797 794 for (;;) { 798 795 hrtimer_forward(&ts->sched_timer, now, tick_period);